mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +01:00
test: Improve code coverage for strnstr(3) unit tests
This commit is contained in:
parent
18ebabf223
commit
25f9b30678
@ -35,11 +35,15 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
assert(strnstr(large, "", strlen(large)) == large);
|
assert(strnstr(large, "", strlen(large)) == large);
|
||||||
|
|
||||||
|
assert(strnstr(large, "far", strlen(large)) == NULL);
|
||||||
assert(strnstr(large, "quux", strlen(large)) == NULL);
|
assert(strnstr(large, "quux", strlen(large)) == NULL);
|
||||||
|
|
||||||
assert(strnstr(large, small, 4) == NULL);
|
assert(strnstr(large, small, 4) == NULL);
|
||||||
|
|
||||||
assert(strnstr(large, small, strlen(large)) == (large + 4));
|
assert(strnstr(large, small, strlen(large)) == (large + 4));
|
||||||
|
|
||||||
|
assert(strnstr("quux", large, strlen("quux")) == NULL);
|
||||||
|
assert(strnstr("foo", large, strlen("foo")) == NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user