diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-09-25 14:24:55 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-09-25 14:24:55 -0400 |
commit | 17679f331403b2d9af84bb4d107bc0ae1f3373f3 (patch) | |
tree | d47fe3a08bfc5ade912a35642e9a830dc8f28eee /string.c | |
parent | 6a2d72af1ac550f5050eeac0be25734c206b9512 (diff) |
move type test objects to file scope, remove need for (void)foo to avoid warnings on unused variables
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,14 +1,14 @@ #include <string.h> #include "test.h" +size_t test_size; + void test_string_h(void) { - size_t size; char dst[64] = { 0 }; char less[] = "a"; char more[] = "b"; char haystack[] = "the five boxing wizards jump quickly"; - (void)size; testing_header("string.h"); @@ -60,6 +60,7 @@ void test_string_h(void) test_true(strspn(haystack, "12345") == 0); test_true(strspn(haystack, "eht") == 3); + test_true(strstr(haystack, "") == haystack); test_true(strstr(haystack, "wizard") == haystack + 16); test_true(strstr(haystack, "rogue") == NULL); |