From: Guillem Jover Date: Sun, 7 Feb 2021 22:24:51 +0000 (+0100) Subject: test: Improve code coverage for strnstr(3) unit tests X-Git-Tag: 0.11.2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25f9b30678b352e8275c98e118f5beacffbb94b4;p=thirdparty%2Flibbsd.git test: Improve code coverage for strnstr(3) unit tests --- 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; }