Lines Matching refs:check

49 check (int thing, int number)
62 check(a != NULL && b != NULL && STREQ (a, b), number);
73 check (strcmp ("", "") == 0, 1); /* Trivial case. */
74 check (strcmp ("a", "a") == 0, 2); /* Identity. */
75 check (strcmp ("abc", "abc") == 0, 3); /* Multicharacter. */
76 check (strcmp ("abc", "abcd") < 0, 4); /* Length mismatches. */
77 check (strcmp ("abcd", "abc") > 0, 5);
78 check (strcmp ("abcd", "abce") < 0, 6); /* Honest miscompares. */
79 check (strcmp ("abce", "abcd") > 0, 7);
80 check (strcmp ("a\203", "a") > 0, 8); /* Tricky if char signed. */
81 check (strcmp ("a\203", "a\003") > 0, 9);
100 check (strcmp (buf1+i,buf2+j) == 0, cnum);
103 check (strcmp (buf1+i,buf2+j) > 0, cnum+1);
104 check (strcmp (buf2+j,buf1+i) < 0, cnum+2);
107 check (strcmp (buf1+i,buf2+j) < 0, cnum+3);
108 check (strcmp (buf2+j,buf1+i) > 0, cnum+4);
111 check (strcmp (buf1+i,buf2+j) > 0, cnum+5);
112 check (strcmp (buf2+j,buf1+i) < 0, cnum+6);
127 check (*cp == '0' + (n % 10), ntest); \
128 check (*cp == '\0', ntest); \
136 check (strcpy (one, "abcd") == one, 1); /* Returned value. */
180 check (strcpy (dst, src) == dst, 1);
189 check ((stpcpy (one, "a") - one) == 1, 1);
192 check ((stpcpy (one, "ab") - one) == 2, 3);
195 check ((stpcpy (one, "abc") - one) == 3, 5);
198 check ((stpcpy (one, "abcd") - one) == 4, 7);
201 check ((stpcpy (one, "abcde") - one) == 5, 9);
204 check ((stpcpy (one, "abcdef") - one) == 6, 11);
207 check ((stpcpy (one, "abcdefg") - one) == 7, 13);
210 check ((stpcpy (one, "abcdefgh") - one) == 8, 15);
213 check ((stpcpy (one, "abcdefghi") - one) == 9, 17);
216 check ((stpcpy (one, "x") - one) == 1, 19);
220 check ((stpcpy (one, "xx") - one) == 2, 22);
224 check ((stpcpy (one, "xxx") - one) == 3, 25);
228 check ((stpcpy (one, "xxxx") - one) == 4, 28);
232 check ((stpcpy (one, "xxxxx") - one) == 5, 31);
236 check ((stpcpy (one, "xxxxxx") - one) == 6, 34);
240 check ((stpcpy (one, "xxxxxxx") - one) == 7, 37);
244 check ((stpcpy (stpcpy (stpcpy (one, "a"), "b"), "c") - one) == 3, 40);
274 check (stpncpy (one, "abc", 2) == one + 2, 1);
275 check (stpncpy (one, "abc", 3) == one + 3, 2);
276 check (stpncpy (one, "abc", 4) == one + 3, 3);
277 check (one[3] == '\0' && one[4] == 'x', 4);
278 check (stpncpy (one, "abcd", 5) == one + 4, 5);
279 check (one[4] == '\0' && one[5] == 'x', 6);
280 check (stpncpy (one, "abcd", 6) == one + 4, 7);
281 check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8);
290 check (strcat (one, "lmn") == one, 1); /* Returned value. */
322 check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */
362 check (strncmp ("", "", 99) == 0, 1); /* Trivial case. */
363 check (strncmp ("a", "a", 99) == 0, 2); /* Identity. */
364 check (strncmp ("abc", "abc", 99) == 0, 3); /* Multicharacter. */
365 check (strncmp ("abc", "abcd", 99) < 0, 4); /* Length unequal. */
366 check (strncmp ("abcd", "abc", 99) > 0, 5);
367 check (strncmp ("abcd", "abce", 99) < 0, 6); /* Honestly unequal. */
368 check (strncmp ("abce", "abcd", 99) > 0, 7);
369 check (strncmp ("a\203", "a", 2) > 0, 8); /* Tricky if '\203' < 0 */
370 check (strncmp ("a\203", "a\003", 2) > 0, 9);
371 check (strncmp ("abce", "abcd", 3) == 0, 10); /* Count limited. */
372 check (strncmp ("abce", "abc", 3) == 0, 11); /* Count == length. */
373 check (strncmp ("abcd", "abce", 4) < 0, 12); /* Nudging limit. */
374 check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */
382 check (strncpy (one, "abc", 4) == one, 1); /* Returned value. */
423 check (strlen ("") == 0, 1); /* Empty. */
424 check (strlen ("a") == 1, 2); /* Single char. */
425 check (strlen ("abcd") == 4, 3); /* Multiple chars. */
435 check (strlen (p) == 2, 4+i);
444 check (strchr ("abcd", 'z') == NULL, 1); /* Not found. */
446 check (strchr (one, 'c') == one+2, 2); /* Basic test. */
447 check (strchr (one, 'd') == one+3, 3); /* End of string. */
448 check (strchr (one, 'a') == one, 4); /* Beginning. */
449 check (strchr (one, '\0') == one+4, 5); /* Finding NUL. */
451 check (strchr (one, 'b') == one+1, 6); /* Finding first. */
453 check (strchr (one, 'b') == NULL, 7); /* Empty string. */
454 check (strchr (one, '\0') == one, 8); /* NUL in empty string. */
464 check (strchr (p, '/') == NULL, 9+i);
477 check (*cp == '\0', 1); /* Not found. */
478 check (cp == os + 4, 2);
480 check (strchrnul (one, 'c') == one+2, 3); /* Basic test. */
481 check (strchrnul (one, 'd') == one+3, 4); /* End of string. */
482 check (strchrnul (one, 'a') == one, 5); /* Beginning. */
483 check (strchrnul (one, '\0') == one+4, 6); /* Finding NUL. */
485 check (strchrnul (one, 'b') == one+1, 7); /* Finding first. */
487 check (strchrnul (one, 'b') == one, 8); /* Empty string. */
488 check (strchrnul (one, '\0') == one, 9); /* NUL in empty string. */
499 check (*cp == '\0', 9+2*i);
500 check (cp == p+2, 10+2*i);
513 check (rawmemchr (one, 'c') == one+2, 1); /* Basic test. */
514 check (rawmemchr (one, 'd') == one+3, 2); /* End of string. */
515 check (rawmemchr (one, 'a') == one, 3); /* Beginning. */
516 check (rawmemchr (one, '\0') == one+4, 4); /* Finding NUL. */
518 check (rawmemchr (one, 'b') == one+1, 5); /* Finding first. */
520 check (rawmemchr (one, '\0') == one, 6); /* NUL in empty string. */
530 check (rawmemchr (p, 'R') == p+8, 6+i);
540 check (index ("abcd", 'z') == NULL, 1); /* Not found. */
542 check (index (one, 'c') == one+2, 2); /* Basic test. */
543 check (index (one, 'd') == one+3, 3); /* End of string. */
544 check (index (one, 'a') == one, 4); /* Beginning. */
545 check (index (one, '\0') == one+4, 5); /* Finding NUL. */
547 check (index (one, 'b') == one+1, 6); /* Finding first. */
549 check (index (one, 'b') == NULL, 7); /* Empty string. */
550 check (index (one, '\0') == one, 8); /* NUL in empty string. */
557 check (strrchr ("abcd", 'z') == NULL, 1); /* Not found. */
559 check (strrchr (one, 'c') == one+2, 2); /* Basic test. */
560 check (strrchr (one, 'd') == one+3, 3); /* End of string. */
561 check (strrchr (one, 'a') == one, 4); /* Beginning. */
562 check (strrchr (one, '\0') == one+4, 5); /* Finding NUL. */
564 check (strrchr (one, 'b') == one+3, 6); /* Finding last. */
566 check (strrchr (one, 'b') == NULL, 7); /* Empty string. */
567 check (strrchr (one, '\0') == one, 8); /* NUL in empty string. */
577 check (strrchr (p, '/') == NULL, 9+i);
589 check (memrchr ("abcd", 'z', 5) == NULL, 1); /* Not found. */
592 check (memrchr (one, 'c', l) == one+2, 2); /* Basic test. */
593 check (memrchr (one, 'd', l) == one+3, 3); /* End of string. */
594 check (memrchr (one, 'a', l) == one, 4); /* Beginning. */
595 check (memrchr (one, '\0', l) == one+4, 5); /* Finding NUL. */
598 check (memrchr (one, 'b', l) == one+3, 6); /* Finding last. */
601 check (memrchr (one, 'b', l) == NULL, 7); /* Empty string. */
602 check (memrchr (one, '\0', l) == one, 8); /* NUL in empty string. */
620 check(memrchr(buf + align, 'x', len) == buf + align + pos, 9);
621 check(memrchr(buf + align + pos + 1, 'x', len - (pos + 1)) == NULL,
635 check (rindex ("abcd", 'z') == NULL, 1); /* Not found. */
637 check (rindex (one, 'c') == one+2, 2); /* Basic test. */
638 check (rindex (one, 'd') == one+3, 3); /* End of string. */
639 check (rindex (one, 'a') == one, 4); /* Beginning. */
640 check (rindex (one, '\0') == one+4, 5); /* Finding NUL. */
642 check (rindex (one, 'b') == one+3, 6); /* Finding last. */
644 check (rindex (one, 'b') == NULL, 7); /* Empty string. */
645 check (rindex (one, '\0') == one, 8); /* NUL in empty string. */
652 check(strpbrk("abcd", "z") == NULL, 1); /* Not found. */
654 check(strpbrk(one, "c") == one+2, 2); /* Basic test. */
655 check(strpbrk(one, "d") == one+3, 3); /* End of string. */
656 check(strpbrk(one, "a") == one, 4); /* Beginning. */
657 check(strpbrk(one, "") == NULL, 5); /* Empty search list. */
658 check(strpbrk(one, "cb") == one+1, 6); /* Multiple search. */
660 check(strpbrk(one, "b") == one+1, 7); /* Finding first. */
661 check(strpbrk(one, "cb") == one+1, 8); /* With multiple search. */
662 check(strpbrk(one, "db") == one+1, 9); /* Another variant. */
664 check(strpbrk(one, "bc") == NULL, 10); /* Empty string. */
666 check(strpbrk(one, "bcd") == NULL, 11); /* Empty string. */
668 check(strpbrk(one, "bcde") == NULL, 12); /* Empty string. */
669 check(strpbrk(one, "") == NULL, 13); /* Both strings empty. */
671 check(strpbrk(one, "befg") == one+1, 14); /* Finding first. */
672 check(strpbrk(one, "cbr") == one+1, 15); /* With multiple search. */
673 check(strpbrk(one, "db") == one+1, 16); /* Another variant. */
674 check(strpbrk(one, "efgh") == one+6, 17); /* And yet another. */
681 check(strstr("abcd", "z") == NULL, 1); /* Not found. */
682 check(strstr("abcd", "abx") == NULL, 2); /* Dead end. */
684 check(strstr(one, "c") == one+2, 3); /* Basic test. */
685 check(strstr(one, "bc") == one+1, 4); /* Multichar. */
686 check(strstr(one, "d") == one+3, 5); /* End of string. */
687 check(strstr(one, "cd") == one+2, 6); /* Tail of string. */
688 check(strstr(one, "abc") == one, 7); /* Beginning. */
689 check(strstr(one, "abcd") == one, 8); /* Exact match. */
690 check(strstr(one, "abcde") == NULL, 9); /* Too long. */
691 check(strstr(one, "de") == NULL, 10); /* Past end. */
692 check(strstr(one, "") == one, 11); /* Finding empty. */
694 check(strstr(one, "ba") == one+1, 12); /* Finding first. */
696 check(strstr(one, "b") == NULL, 13); /* Empty string. */
697 check(strstr(one, "") == one, 14); /* Empty in empty string. */
699 check(strstr(one, "bca") == one+2, 15); /* False start. */
701 check(strstr(one, "bbca") == one+1, 16); /* With overlap. */
708 check(strspn("abcba", "abc") == 5, 1); /* Whole string. */
709 check(strspn("abcba", "ab") == 2, 2); /* Partial. */
710 check(strspn("abc", "qx") == 0, 3); /* None. */
711 check(strspn("", "ab") == 0, 4); /* Null string. */
712 check(strspn("abc", "") == 0, 5); /* Null search list. */
719 check(strcspn("abcba", "qx") == 5, 1); /* Whole string. */
720 check(strcspn("abcba", "cx") == 2, 2); /* Partial. */
721 check(strcspn("abc", "abc") == 0, 3); /* None. */
722 check(strcspn("", "ab") == 0, 4); /* Null string. */
723 check(strcspn("abc", "") == 3, 5); /* Null search list. */
735 check(strtok((char *)NULL, ", ") == NULL, 5);
738 check(strtok((char *)NULL, ", ") == NULL, 7);
746 check(strtok((char *)NULL, "-") == NULL, 13);
752 check(strtok((char *)NULL, ", ") == NULL, 18);
753 check(strtok((char *)NULL, ", ") == NULL, 19); /* Persistence. */
755 check(strtok(one, ", ") == NULL, 20); /* No tokens. */
757 check(strtok(one, ", ") == NULL, 21); /* Empty string. */
760 check(strtok((char *)NULL, ", ") == NULL, 23);
763 check(strtok((char *)NULL, "") == NULL, 25);
769 check(strtok((char *)NULL, ",") == NULL, 29);
786 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 5);
790 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 7);
800 check(strtok_r((char *)NULL, "-", &cp) == NULL, 13);
807 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 18);
808 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 19); /* Persistence. */
811 check(strtok_r(one, ", ", &cp) == NULL, 20); /* No tokens. */
814 check(strtok_r(one, ", ", &cp) == NULL, 21); /* Empty string. */
815 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 22); /* Persistence. */
819 check(strtok_r((char *)NULL, ", ", &cp) == NULL, 24);
823 check(strtok_r((char *)NULL, "", &cp) == NULL, 26);
830 check(strtok_r((char *)NULL, ",", &cp) == NULL, 30);
849 check(strsep(&cp, ", ") == NULL, 7);
856 check(strsep(&cp, ", ") == NULL, 13);
866 check(strsep(&cp, "-") == NULL, 21);
877 check(strsep(&cp, ", ") == NULL, 31);
878 check(strsep(&cp, ", ") == NULL, 32); /* Persistence. */
883 check(strsep(&cp, ", ") == NULL, 36); /* No tokens. */
886 check(strsep(&cp, ", ") == NULL, 38); /* Empty string. */
889 check(strsep(&cp, ", ") == NULL, 40);
892 check(strsep(&cp, "") == NULL, 42);
898 check(strsep(&cp, ",") == NULL, 46);
912 check (strsep (&list, ",") == NULL, 55);
924 check(strsep(&cp, ",") == NULL, 63);
925 check(strsep(&cp, ",") == NULL, 64); /* Persistence. */
935 check(strsep(&cp, "x,y") == NULL, 72);
936 check(strsep(&cp, ",xy") == NULL, 73); /* Persistence. */
943 check(ptr == one + 3, 76);
944 check(cp == NULL, 77);
951 check(ptr == one + 3, 80);
955 check(cp == NULL, 82);
961 check(ptr == one, 84);
962 check(cp == NULL, 85);
968 check(ptr == one , 87);
969 check(cp == NULL, 88);
976 check(memcmp("a", "a", 1) == 0, 1); /* Identity. */
977 check(memcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */
978 check(memcmp("abcd", "abce", 4) < 0, 3); /* Honestly unequal. */
979 check(memcmp("abce", "abcd", 4) > 0, 4);
980 check(memcmp("alph", "beta", 4) < 0, 5);
981 check(memcmp("a\203", "a\003", 2) > 0, 6);
982 check(memcmp("abce", "abcd", 3) == 0, 7); /* Count limited. */
983 check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */
990 check(memchr("abcd", 'z', 4) == NULL, 1); /* Not found. */
992 check(memchr(one, 'c', 4) == one+2, 2); /* Basic test. */
993 check(memchr(one, ~0xff|'c', 4) == one+2, 2); /* ignore highorder bits. */
994 check(memchr(one, 'd', 4) == one+3, 3); /* End of string. */
995 check(memchr(one, 'a', 4) == one, 4); /* Beginning. */
996 check(memchr(one, '\0', 5) == one+4, 5); /* Finding NUL. */
998 check(memchr(one, 'b', 5) == one+1, 6); /* Finding first. */
999 check(memchr(one, 'b', 0) == NULL, 7); /* Zero count. */
1000 check(memchr(one, 'a', 1) == one, 8); /* Singleton case. */
1002 check(memchr(one, 0203, 3) == one+1, 9); /* Unsignedness. */
1020 check(memchr(buf + align, 'x', len) == buf + align + pos, 10);
1021 check(memchr(buf + align, 'x', pos) == NULL, 11);
1034 check(memcpy(one, "abc", 4) == one, 1); /* Returned value. */
1055 check (memcpy (one + i, "hi there", 9) == one + i,
1057 check (memcmp (one, x, i) == 0, 8 + (i * 6)); /* Wrote under? */
1059 check (one[i + 9] == 'x', 10 + (i * 6)); /* Wrote over? */
1060 check (memcpy (two, one + i, 9) == two,
1072 check(mempcpy(one, "abc", 4) == one + 4, 1); /* Returned value. */
1093 check (mempcpy (one + i, "hi there", 9) == one + i + 9,
1095 check (memcmp (one, x, i) == 0, 8 + (i * 6)); /* Wrote under? */
1097 check (one[i + 9] == 'x', 10 + (i * 6)); /* Wrote over? */
1098 check (mempcpy (two, one + i, 9) == two + 9,
1109 check(memmove(one, "abc", 4) == one, 1); /* Returned value. */
1147 check(memccpy(one, "abc", 'q', 4) == NULL, 1); /* Returned value. */
1166 check(memccpy(two, one, 'f', 9) == two+6, 7); /* Returned value. */
1172 check(memccpy(two, one, 'a', 4) == two+1, 10); /* First char. */
1174 check(memccpy(two, one, 'd', 4) == two+4, 12); /* Last char. */
1177 check(memccpy(two, one, 'x', 1) == two+1, 14); /* Singleton. */
1188 check(memset(one+1, 'x', 3) == one+1, 1); /* Return value. */
1204 check (one[i] == '\01', 7);
1217 for (c = 0; c <= 'y'; c += 'y') /* check for memset(,0,) and
1238 check (0, 8 + i + j * 256 + (c != 0) * 256 * 256);
1289 check(p != NULL, 1);
1294 check(q != NULL, 3);
1301 check(p != NULL, 5);
1312 check(bcmp("a", "a", 1) == 0, 1); /* Identity. */
1313 check(bcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */
1314 check(bcmp("abcd", "abce", 4) != 0, 3); /* Honestly unequal. */
1315 check(bcmp("abce", "abcd", 4) != 0, 4);
1316 check(bcmp("alph", "beta", 4) != 0, 5);
1317 check(bcmp("abce", "abcd", 3) == 0, 6); /* Count limited. */
1318 check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */
1325 check(strerror(EDOM) != 0, 1);
1326 check(strerror(ERANGE) != 0, 2);
1327 check(strerror(ENOENT) != 0, 3);
1335 check(strcasecmp("a", "a") == 0, 1);
1336 check(strcasecmp("a", "A") == 0, 2);
1337 check(strcasecmp("A", "a") == 0, 3);
1338 check(strcasecmp("a", "b") < 0, 4);
1339 check(strcasecmp("c", "b") > 0, 5);
1340 check(strcasecmp("abc", "AbC") == 0, 6);
1341 check(strcasecmp("0123456789", "0123456789") == 0, 7);
1342 check(strcasecmp("", "0123456789") < 0, 8);
1343 check(strcasecmp("AbC", "") > 0, 9);
1344 check(strcasecmp("AbC", "A") > 0, 10);
1345 check(strcasecmp("AbC", "Ab") > 0, 11);
1346 check(strcasecmp("AbC", "ab") > 0, 12);
1354 check(strncasecmp("a", "a", 5) == 0, 1);
1355 check(strncasecmp("a", "A", 5) == 0, 2);
1356 check(strncasecmp("A", "a", 5) == 0, 3);
1357 check(strncasecmp("a", "b", 5) < 0, 4);
1358 check(strncasecmp("c", "b", 5) > 0, 5);
1359 check(strncasecmp("abc", "AbC", 5) == 0, 6);
1360 check(strncasecmp("0123456789", "0123456789", 10) == 0, 7);
1361 check(strncasecmp("", "0123456789", 10) < 0, 8);
1362 check(strncasecmp("AbC", "", 5) > 0, 9);
1363 check(strncasecmp("AbC", "A", 5) > 0, 10);
1364 check(strncasecmp("AbC", "Ab", 5) > 0, 11);
1365 check(strncasecmp("AbC", "ab", 5) > 0, 12);
1366 check(strncasecmp("0123456789", "AbC", 0) == 0, 13);
1367 check(strncasecmp("AbC", "abc", 1) == 0, 14);
1368 check(strncasecmp("AbC", "abc", 2) == 0, 15);
1369 check(strncasecmp("AbC", "abc", 3) == 0, 16);
1370 check(strncasecmp("AbC", "abcd", 3) == 0, 17);
1371 check(strncasecmp("AbC", "abcd", 4) < 0, 18);
1372 check(strncasecmp("ADC", "abcd", 1) == 0, 19);
1373 check(strncasecmp("ADC", "abcd", 2) > 0, 20);
1380 check(strcasestr("abCd", "z") == NULL, 1); /* Not found. */
1381 check(strcasestr("AbcD", "abX") == NULL, 2); /* Dead end. */
1383 check(strcasestr(one, "c") == one+2, 3); /* Basic test. */
1384 check(strcasestr(one, "Bc") == one+1, 4); /* Multichar. */
1385 check(strcasestr(one, "d") == one+3, 5); /* End of string. */
1386 check(strcasestr(one, "Cd") == one+2, 6); /* Tail of string. */
1387 check(strcasestr(one, "aBc") == one, 7); /* Beginning. */
1388 check(strcasestr(one, "aBcd") == one, 8); /* Exact match. */
1389 check(strcasestr(one, "AbcDe") == NULL, 9); /* Too long. */
1390 check(strcasestr(one, "dE") == NULL, 10); /* Past end. */
1391 check(strcasestr(one, "") == one, 11); /* Finding empty. */
1393 check(strcasestr(one, "Ba") == one+1, 12); /* Finding first. */
1395 check(strcasestr(one, "b") == NULL, 13); /* Empty string. */
1396 check(strcasestr(one, "") == one, 14); /* Empty in empty string. */
1398 check(strcasestr(one, "bCa") == one+2, 15); /* False start. */
1400 check(strcasestr(one, "bbCa") == one+1, 16); /* With overlap. */