summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2021-02-07 23:24:51 +0100
committerGuillem Jover <guillem@hadrons.org>2021-02-07 23:24:51 +0100
commit25f9b30678b352e8275c98e118f5beacffbb94b4 (patch)
treee30169d9a03b07f8c9e0b41dd830705568e0de2a
parent18ebabf22306453f29ef63b1b1e7fb6c9ebb6ebf (diff)
test: Improve code coverage for strnstr(3) unit tests
-rw-r--r--test/strnstr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/strnstr.c b/test/strnstr.c
index 6cef281..3d89fa8 100644
--- a/test/strnstr.c
+++ b/test/strnstr.c
@@ -35,11 +35,15 @@ main(int argc, char **argv)
assert(strnstr(large, "", strlen(large)) == large);
+ assert(strnstr(large, "far", strlen(large)) == NULL);
assert(strnstr(large, "quux", strlen(large)) == NULL);
assert(strnstr(large, small, 4) == NULL);
assert(strnstr(large, small, strlen(large)) == (large + 4));
+ assert(strnstr("quux", large, strlen("quux")) == NULL);
+ assert(strnstr("foo", large, strlen("foo")) == NULL);
+
return 0;
}