Lines Matching refs:check

38 #define check(thing) checkit(thing, __LINE__)  macro
84 check(strcmp("", "") == 0); /* Trivial case. */ in test_string()
85 check(strcmp("a", "a") == 0); /* Identity. */ in test_string()
86 check(strcmp("abc", "abc") == 0); /* Multicharacter. */ in test_string()
87 check(strcmp("abc", "abcd") < 0); /* Length mismatches. */ in test_string()
88 check(strcmp("abcd", "abc") > 0); in test_string()
89 check(strcmp("abcd", "abce") < 0); /* Honest miscompares. */ in test_string()
90 check(strcmp("abce", "abcd") > 0); in test_string()
91 check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */ in test_string()
92 check(strcmp("a\103", "a\003") > 0); in test_string()
96 check(strcpy(one, "abcd") == one); /* Returned value. */ in test_string()
114 check(strcat(one, "lmn") == one); /* Returned value. */ in test_string()
142 check(strncat(one, "lmn", 99) == one); /* Returned value. */ in test_string()
177 check(strncmp("", "", 99) == 0); /* Trivial case. */ in test_string()
178 check(strncmp("a", "a", 99) == 0); /* Identity. */ in test_string()
179 check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */ in test_string()
180 check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */ in test_string()
181 check(strncmp("abcd", "abc",99) > 0); in test_string()
182 check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */ in test_string()
183 check(strncmp("abce", "abcd",99)>0); in test_string()
184 check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */ in test_string()
185 check(strncmp("abce", "abc", 3) == 0); /* Count == length. */ in test_string()
186 check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */ in test_string()
187 check(strncmp("abc", "def", 0) == 0); /* Zero count. */ in test_string()
191 check(strncpy(one, "abc", 4) == one); /* Returned value. */ in test_string()
229 check(strlen("") == 0); /* Empty. */ in test_string()
230 check(strlen("a") == 1); /* Single char. */ in test_string()
231 check(strlen("abcd") == 4); /* Multiple chars. */ in test_string()
235 check(strchr("abcd", 'z') == NULL); /* Not found. */ in test_string()
237 check(strchr(one, 'c') == one+2); /* Basic test. */ in test_string()
238 check(strchr(one, 'd') == one+3); /* End of string. */ in test_string()
239 check(strchr(one, 'a') == one); /* Beginning. */ in test_string()
240 check(strchr(one, '\0') == one+4); /* Finding NUL. */ in test_string()
242 check(strchr(one, 'b') == one+1); /* Finding first. */ in test_string()
244 check(strchr(one, 'b') == NULL); /* Empty string. */ in test_string()
245 check(strchr(one, '\0') == one); /* NUL in empty string. */ in test_string()
249 check(index("abcd", 'z') == NULL); /* Not found. */ in test_string()
251 check(index(one, 'c') == one+2); /* Basic test. */ in test_string()
252 check(index(one, 'd') == one+3); /* End of string. */ in test_string()
253 check(index(one, 'a') == one); /* Beginning. */ in test_string()
254 check(index(one, '\0') == one+4); /* Finding NUL. */ in test_string()
256 check(index(one, 'b') == one+1); /* Finding first. */ in test_string()
258 check(index(one, 'b') == NULL); /* Empty string. */ in test_string()
259 check(index(one, '\0') == one); /* NUL in empty string. */ in test_string()
263 check(strrchr("abcd", 'z') == NULL); /* Not found. */ in test_string()
265 check(strrchr(one, 'c') == one+2); /* Basic test. */ in test_string()
266 check(strrchr(one, 'd') == one+3); /* End of string. */ in test_string()
267 check(strrchr(one, 'a') == one); /* Beginning. */ in test_string()
268 check(strrchr(one, '\0') == one+4); /* Finding NUL. */ in test_string()
270 check(strrchr(one, 'b') == one+3); /* Finding last. */ in test_string()
272 check(strrchr(one, 'b') == NULL); /* Empty string. */ in test_string()
273 check(strrchr(one, '\0') == one); /* NUL in empty string. */ in test_string()
277 check(rindex("abcd", 'z') == NULL); /* Not found. */ in test_string()
279 check(rindex(one, 'c') == one+2); /* Basic test. */ in test_string()
280 check(rindex(one, 'd') == one+3); /* End of string. */ in test_string()
281 check(rindex(one, 'a') == one); /* Beginning. */ in test_string()
282 check(rindex(one, '\0') == one+4); /* Finding NUL. */ in test_string()
284 check(rindex(one, 'b') == one+3); /* Finding last. */ in test_string()
286 check(rindex(one, 'b') == NULL); /* Empty string. */ in test_string()
287 check(rindex(one, '\0') == one); /* NUL in empty string. */ in test_string()
291 check(strpbrk("abcd", "z") == NULL); /* Not found. */ in test_string()
293 check(strpbrk(one, "c") == one+2); /* Basic test. */ in test_string()
294 check(strpbrk(one, "d") == one+3); /* End of string. */ in test_string()
295 check(strpbrk(one, "a") == one); /* Beginning. */ in test_string()
296 check(strpbrk(one, "") == NULL); /* Empty search list. */ in test_string()
297 check(strpbrk(one, "cb") == one+1); /* Multiple search. */ in test_string()
299 check(strpbrk(one, "b") == one+1); /* Finding first. */ in test_string()
300 check(strpbrk(one, "cb") == one+1); /* With multiple search. */ in test_string()
301 check(strpbrk(one, "db") == one+1); /* Another variant. */ in test_string()
303 check(strpbrk(one, "bc") == NULL); /* Empty string. */ in test_string()
304 check(strpbrk(one, "") == NULL); /* Both strings empty. */ in test_string()
308 check(strstr("z", "abcd") == NULL); /* Not found. */ in test_string()
309 check(strstr("abx", "abcd") == NULL); /* Dead end. */ in test_string()
311 check(strstr(one,"c") == one+2); /* Basic test. */ in test_string()
312 check(strstr(one, "bc") == one+1); /* Multichar. */ in test_string()
313 check(strstr(one,"d") == one+3); /* End of string. */ in test_string()
314 check(strstr(one,"cd") == one+2); /* Tail of string. */ in test_string()
315 check(strstr(one,"abc") == one); /* Beginning. */ in test_string()
316 check(strstr(one,"abcd") == one); /* Exact match. */ in test_string()
317 check(strstr(one,"de") == NULL); /* Past end. */ in test_string()
318 check(strstr(one,"") == one); /* Finding empty. */ in test_string()
320 check(strstr(one,"ba") == one+1); /* Finding first. */ in test_string()
322 check(strstr(one, "b") == NULL); /* Empty string. */ in test_string()
323 check(strstr(one,"") == one); /* Empty in empty string. */ in test_string()
325 check(strstr(one,"bca") == one+2); /* False start. */ in test_string()
327 check(strstr(one,"bbca") == one+1); /* With overlap. */ in test_string()
331 check(strspn("abcba", "abc") == 5); /* Whole string. */ in test_string()
332 check(strspn("abcba", "ab") == 2); /* Partial. */ in test_string()
333 check(strspn("abc", "qx") == 0); /* None. */ in test_string()
334 check(strspn("", "ab") == 0); /* Null string. */ in test_string()
335 check(strspn("abc", "") == 0); /* Null search list. */ in test_string()
339 check(strcspn("abcba", "qx") == 5); /* Whole string. */ in test_string()
340 check(strcspn("abcba", "cx") == 2); /* Partial. */ in test_string()
341 check(strcspn("abc", "abc") == 0); /* None. */ in test_string()
342 check(strcspn("", "ab") == 0); /* Null string. */ in test_string()
343 check(strcspn("abc", "") == 3); /* Null search list. */ in test_string()
352 check(strtok((char *)NULL, ", ") == NULL); in test_string()
355 check(strtok((char *)NULL, ", ") == NULL); in test_string()
363 check(strtok((char *)NULL, "-") == NULL); in test_string()
369 check(strtok((char *)NULL, ", ") == NULL); in test_string()
370 check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */ in test_string()
372 check(strtok(one, ", ") == NULL); /* No tokens. */ in test_string()
374 check(strtok(one, ", ") == NULL); /* Empty string. */ in test_string()
377 check(strtok((char *)NULL, ", ") == NULL); in test_string()
380 check(strtok((char *)NULL, "") == NULL); in test_string()
386 check(strtok((char *)NULL, ",") == NULL); in test_string()
394 check(memcmp("a", "a", 1) == 0); /* Identity. */ in test_string()
395 check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */ in test_string()
396 check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */ in test_string()
397 check(memcmp("abce", "abcd",4)); in test_string()
398 check(memcmp("alph", "beta", 4) < 0); in test_string()
399 check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */ in test_string()
400 check(memcmp("abc", "def", 0) == 0); /* Zero count. */ in test_string()
405 check(memcmp(one, two,1) > 0); in test_string()
410 check(memchr("abcd", 'z', 4) == NULL); /* Not found. */ in test_string()
412 check(memchr(one, 'c', 4) == one+2); /* Basic test. */ in test_string()
413 check(memchr(one, 'd', 4) == one+3); /* End of string. */ in test_string()
414 check(memchr(one, 'a', 4) == one); /* Beginning. */ in test_string()
415 check(memchr(one, '\0', 5) == one+4); /* Finding NUL. */ in test_string()
417 check(memchr(one, 'b', 5) == one+1); /* Finding first. */ in test_string()
418 check(memchr(one, 'b', 0) == NULL); /* Zero count. */ in test_string()
419 check(memchr(one, 'a', 1) == one); /* Singleton case. */ in test_string()
421 check(memchr(one, 0203, 3) == one+1); /* Unsignedness. */ in test_string()
425 check(memcpy(one, "abc", 4) == one); /* Returned value. */ in test_string()
444 check(memmove(one, "abc", 4) == one); /* Returned value. */ in test_string()
479 check(memccpy(one, "abc", 'q', 4) == NULL); /* Returned value. */ in test_string()
498 check(memccpy(two, one, 'f', 9) == two+6); /* Returned value. */ in test_string()
504 check(memccpy(two, one, 'a', 4) == two+1); /* First char. */ in test_string()
506 check(memccpy(two, one, 'd', 4) == two+4); /* Last char. */ in test_string()
509 check(memccpy(two, one, 'x', 1) == two+1); /* Singleton. */ in test_string()
515 check(memset(one+1, 'x', 3) == one+1); /* Return value. */ in test_string()
562 check(bcmp("a", "a", 1) == 0); /* Identity. */ in test_string()
563 check(bcmp("abc", "abc", 3) == 0); /* Multicharacter. */ in test_string()
564 check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */ in test_string()
565 check(bcmp("abce", "abcd",4)); in test_string()
566 check(bcmp("alph", "beta", 4) != 0); in test_string()
567 check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */ in test_string()
568 check(bcmp("abc", "def", 0) == 0); /* Zero count. */ in test_string()
577 check(f < 0 && errno > 0 && errno < _sys_nerr); in test_string()