• Home
  • Raw
  • Download

Lines Matching refs:one

65 char one[50];  variable
123 for (__n = 0; __n < (int) sizeof (one); ++__n) \
124 one[__n] = 'Z'; \
125 fn (one, str); \
126 for (cp = one, __n = 0; __n < n; ++__n, ++cp) \
136 check (strcpy (one, "abcd") == one, 1); /* Returned value. */ in test_strcpy()
137 equal (one, "abcd", 2); /* Basic test. */ in test_strcpy()
139 (void) strcpy (one, "x"); in test_strcpy()
140 equal (one, "x", 3); /* Writeover. */ in test_strcpy()
141 equal (one+2, "cd", 4); /* Wrote too much? */ in test_strcpy()
144 (void) strcpy (one, two); in test_strcpy()
145 equal (one, "hi there", 5); /* Basic test encore. */ in test_strcpy()
148 (void) strcpy (one, ""); in test_strcpy()
149 equal (one, "", 7); /* Boundary condition. */ in test_strcpy()
153 (void) strcpy (one + i, "hi there"); /* Unaligned destination. */ in test_strcpy()
154 equal (one + i, "hi there", 8 + (i * 2)); in test_strcpy()
155 (void) strcpy (two, one + i); /* Unaligned source. */ in test_strcpy()
179 void *dst = one; in test_strcpy()
189 check ((stpcpy (one, "a") - one) == 1, 1); in test_stpcpy()
190 equal (one, "a", 2); in test_stpcpy()
192 check ((stpcpy (one, "ab") - one) == 2, 3); in test_stpcpy()
193 equal (one, "ab", 4); in test_stpcpy()
195 check ((stpcpy (one, "abc") - one) == 3, 5); in test_stpcpy()
196 equal (one, "abc", 6); in test_stpcpy()
198 check ((stpcpy (one, "abcd") - one) == 4, 7); in test_stpcpy()
199 equal (one, "abcd", 8); in test_stpcpy()
201 check ((stpcpy (one, "abcde") - one) == 5, 9); in test_stpcpy()
202 equal (one, "abcde", 10); in test_stpcpy()
204 check ((stpcpy (one, "abcdef") - one) == 6, 11); in test_stpcpy()
205 equal (one, "abcdef", 12); in test_stpcpy()
207 check ((stpcpy (one, "abcdefg") - one) == 7, 13); in test_stpcpy()
208 equal (one, "abcdefg", 14); in test_stpcpy()
210 check ((stpcpy (one, "abcdefgh") - one) == 8, 15); in test_stpcpy()
211 equal (one, "abcdefgh", 16); in test_stpcpy()
213 check ((stpcpy (one, "abcdefghi") - one) == 9, 17); in test_stpcpy()
214 equal (one, "abcdefghi", 18); in test_stpcpy()
216 check ((stpcpy (one, "x") - one) == 1, 19); in test_stpcpy()
217 equal (one, "x", 20); /* Writeover. */ in test_stpcpy()
218 equal (one+2, "cdefghi", 21); /* Wrote too much? */ in test_stpcpy()
220 check ((stpcpy (one, "xx") - one) == 2, 22); in test_stpcpy()
221 equal (one, "xx", 23); /* Writeover. */ in test_stpcpy()
222 equal (one+3, "defghi", 24); /* Wrote too much? */ in test_stpcpy()
224 check ((stpcpy (one, "xxx") - one) == 3, 25); in test_stpcpy()
225 equal (one, "xxx", 26); /* Writeover. */ in test_stpcpy()
226 equal (one+4, "efghi", 27); /* Wrote too much? */ in test_stpcpy()
228 check ((stpcpy (one, "xxxx") - one) == 4, 28); in test_stpcpy()
229 equal (one, "xxxx", 29); /* Writeover. */ in test_stpcpy()
230 equal (one+5, "fghi", 30); /* Wrote too much? */ in test_stpcpy()
232 check ((stpcpy (one, "xxxxx") - one) == 5, 31); in test_stpcpy()
233 equal (one, "xxxxx", 32); /* Writeover. */ in test_stpcpy()
234 equal (one+6, "ghi", 33); /* Wrote too much? */ in test_stpcpy()
236 check ((stpcpy (one, "xxxxxx") - one) == 6, 34); in test_stpcpy()
237 equal (one, "xxxxxx", 35); /* Writeover. */ in test_stpcpy()
238 equal (one+7, "hi", 36); /* Wrote too much? */ in test_stpcpy()
240 check ((stpcpy (one, "xxxxxxx") - one) == 7, 37); in test_stpcpy()
241 equal (one, "xxxxxxx", 38); /* Writeover. */ in test_stpcpy()
242 equal (one+8, "i", 39); /* Wrote too much? */ in test_stpcpy()
244 check ((stpcpy (stpcpy (stpcpy (one, "a"), "b"), "c") - one) == 3, 40); in test_stpcpy()
245 equal (one, "abc", 41); in test_stpcpy()
246 equal (one + 4, "xxx", 42); in test_stpcpy()
273 memset (one, 'x', sizeof (one)); in test_stpncpy()
274 check (stpncpy (one, "abc", 2) == one + 2, 1); in test_stpncpy()
275 check (stpncpy (one, "abc", 3) == one + 3, 2); in test_stpncpy()
276 check (stpncpy (one, "abc", 4) == one + 3, 3); in test_stpncpy()
277 check (one[3] == '\0' && one[4] == 'x', 4); in test_stpncpy()
278 check (stpncpy (one, "abcd", 5) == one + 4, 5); in test_stpncpy()
279 check (one[4] == '\0' && one[5] == 'x', 6); in test_stpncpy()
280 check (stpncpy (one, "abcd", 6) == one + 4, 7); in test_stpncpy()
281 check (one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8); in test_stpncpy()
289 (void) strcpy (one, "ijk"); in test_strcat()
290 check (strcat (one, "lmn") == one, 1); /* Returned value. */ in test_strcat()
291 equal (one, "ijklmn", 2); /* Basic test. */ in test_strcat()
293 (void) strcpy (one, "x"); in test_strcat()
294 (void) strcat (one, "yz"); in test_strcat()
295 equal (one, "xyz", 3); /* Writeover. */ in test_strcat()
296 equal (one+4, "mn", 4); /* Wrote too much? */ in test_strcat()
298 (void) strcpy (one, "gh"); in test_strcat()
300 (void) strcat (one, two); in test_strcat()
301 equal (one, "ghef", 5); /* Basic test encore. */ in test_strcat()
304 (void) strcpy (one, ""); in test_strcat()
305 (void) strcat (one, ""); in test_strcat()
306 equal (one, "", 7); /* Boundary conditions. */ in test_strcat()
307 (void) strcpy (one, "ab"); in test_strcat()
308 (void) strcat (one, ""); in test_strcat()
309 equal (one, "ab", 8); in test_strcat()
310 (void) strcpy (one, ""); in test_strcat()
311 (void) strcat (one, "cd"); in test_strcat()
312 equal (one, "cd", 9); in test_strcat()
321 (void) strcpy (one, "ijk"); in test_strncat()
322 check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */ in test_strncat()
323 equal (one, "ijklmn", 2); /* Basic test. */ in test_strncat()
325 (void) strcpy (one, "x"); in test_strncat()
326 (void) strncat (one, "yz", 99); in test_strncat()
327 equal (one, "xyz", 3); /* Writeover. */ in test_strncat()
328 equal (one+4, "mn", 4); /* Wrote too much? */ in test_strncat()
330 (void) strcpy (one, "gh"); in test_strncat()
332 (void) strncat (one, two, 99); in test_strncat()
333 equal (one, "ghef", 5); /* Basic test encore. */ in test_strncat()
336 (void) strcpy (one, ""); in test_strncat()
337 (void) strncat (one, "", 99); in test_strncat()
338 equal (one, "", 7); /* Boundary conditions. */ in test_strncat()
339 (void) strcpy (one, "ab"); in test_strncat()
340 (void) strncat (one, "", 99); in test_strncat()
341 equal (one, "ab", 8); in test_strncat()
342 (void) strcpy (one, ""); in test_strncat()
343 (void) strncat (one, "cd", 99); in test_strncat()
344 equal (one, "cd", 9); in test_strncat()
346 (void) strcpy (one, "ab"); in test_strncat()
347 (void) strncat (one, "cdef", 2); in test_strncat()
348 equal (one, "abcd", 10); /* Count-limited. */ in test_strncat()
350 (void) strncat (one, "gh", 0); in test_strncat()
351 equal (one, "abcd", 11); /* Zero count. */ in test_strncat()
353 (void) strncat (one, "gh", 2); in test_strncat()
354 equal (one, "abcdgh", 12); /* Count and length equal. */ in test_strncat()
382 check (strncpy (one, "abc", 4) == one, 1); /* Returned value. */ in test_strncpy()
383 equal (one, "abc", 2); /* Did the copy go right? */ in test_strncpy()
385 (void) strcpy (one, "abcdefgh"); in test_strncpy()
386 (void) strncpy (one, "xyz", 2); in test_strncpy()
387 equal (one, "xycdefgh", 3); /* Copy cut by count. */ in test_strncpy()
389 (void) strcpy (one, "abcdefgh"); in test_strncpy()
390 (void) strncpy (one, "xyz", 3); /* Copy cut just before NUL. */ in test_strncpy()
391 equal (one, "xyzdefgh", 4); in test_strncpy()
393 (void) strcpy (one, "abcdefgh"); in test_strncpy()
394 (void) strncpy (one, "xyz", 4); /* Copy just includes NUL. */ in test_strncpy()
395 equal (one, "xyz", 5); in test_strncpy()
396 equal (one+4, "efgh", 6); /* Wrote too much? */ in test_strncpy()
398 (void) strcpy (one, "abcdefgh"); in test_strncpy()
399 (void) strncpy (one, "xyz", 5); /* Copy includes padding. */ in test_strncpy()
400 equal (one, "xyz", 7); in test_strncpy()
401 equal (one+4, "", 8); in test_strncpy()
402 equal (one+5, "fgh", 9); in test_strncpy()
404 (void) strcpy (one, "abc"); in test_strncpy()
405 (void) strncpy (one, "xyz", 0); /* Zero-length copy. */ in test_strncpy()
406 equal (one, "abc", 10); in test_strncpy()
408 (void) strncpy (one, "", 2); /* Zero-length source. */ in test_strncpy()
409 equal (one, "", 11); in test_strncpy()
410 equal (one+1, "", 12); in test_strncpy()
411 equal (one+2, "c", 13); in test_strncpy()
413 (void) strcpy (one, "hi there"); in test_strncpy()
414 (void) strncpy (two, one, 9); in test_strncpy()
416 equal (one, "hi there", 15); /* Stomped on source? */ in test_strncpy()
445 (void) strcpy (one, "abcd"); in test_strchr()
446 check (strchr (one, 'c') == one+2, 2); /* Basic test. */ in test_strchr()
447 check (strchr (one, 'd') == one+3, 3); /* End of string. */ in test_strchr()
448 check (strchr (one, 'a') == one, 4); /* Beginning. */ in test_strchr()
449 check (strchr (one, '\0') == one+4, 5); /* Finding NUL. */ in test_strchr()
450 (void) strcpy (one, "ababa"); in test_strchr()
451 check (strchr (one, 'b') == one+1, 6); /* Finding first. */ in test_strchr()
452 (void) strcpy (one, ""); in test_strchr()
453 check (strchr (one, 'b') == NULL, 7); /* Empty string. */ in test_strchr()
454 check (strchr (one, '\0') == one, 8); /* NUL in empty string. */ in test_strchr()
479 (void) strcpy (one, "abcd"); in test_strchrnul()
480 check (strchrnul (one, 'c') == one+2, 3); /* Basic test. */ in test_strchrnul()
481 check (strchrnul (one, 'd') == one+3, 4); /* End of string. */ in test_strchrnul()
482 check (strchrnul (one, 'a') == one, 5); /* Beginning. */ in test_strchrnul()
483 check (strchrnul (one, '\0') == one+4, 6); /* Finding NUL. */ in test_strchrnul()
484 (void) strcpy (one, "ababa"); in test_strchrnul()
485 check (strchrnul (one, 'b') == one+1, 7); /* Finding first. */ in test_strchrnul()
486 (void) strcpy (one, ""); in test_strchrnul()
487 check (strchrnul (one, 'b') == one, 8); /* Empty string. */ in test_strchrnul()
488 check (strchrnul (one, '\0') == one, 9); /* NUL in empty string. */ in test_strchrnul()
512 (void) strcpy (one, "abcd"); in test_rawmemchr()
513 check (rawmemchr (one, 'c') == one+2, 1); /* Basic test. */ in test_rawmemchr()
514 check (rawmemchr (one, 'd') == one+3, 2); /* End of string. */ in test_rawmemchr()
515 check (rawmemchr (one, 'a') == one, 3); /* Beginning. */ in test_rawmemchr()
516 check (rawmemchr (one, '\0') == one+4, 4); /* Finding NUL. */ in test_rawmemchr()
517 (void) strcpy (one, "ababa"); in test_rawmemchr()
518 check (rawmemchr (one, 'b') == one+1, 5); /* Finding first. */ in test_rawmemchr()
519 (void) strcpy (one, ""); in test_rawmemchr()
520 check (rawmemchr (one, '\0') == one, 6); /* NUL in empty string. */ in test_rawmemchr()
541 (void) strcpy (one, "abcd"); in test_index()
542 check (index (one, 'c') == one+2, 2); /* Basic test. */ in test_index()
543 check (index (one, 'd') == one+3, 3); /* End of string. */ in test_index()
544 check (index (one, 'a') == one, 4); /* Beginning. */ in test_index()
545 check (index (one, '\0') == one+4, 5); /* Finding NUL. */ in test_index()
546 (void) strcpy (one, "ababa"); in test_index()
547 check (index (one, 'b') == one+1, 6); /* Finding first. */ in test_index()
548 (void) strcpy (one, ""); in test_index()
549 check (index (one, 'b') == NULL, 7); /* Empty string. */ in test_index()
550 check (index (one, '\0') == one, 8); /* NUL in empty string. */ in test_index()
558 (void) strcpy (one, "abcd"); in test_strrchr()
559 check (strrchr (one, 'c') == one+2, 2); /* Basic test. */ in test_strrchr()
560 check (strrchr (one, 'd') == one+3, 3); /* End of string. */ in test_strrchr()
561 check (strrchr (one, 'a') == one, 4); /* Beginning. */ in test_strrchr()
562 check (strrchr (one, '\0') == one+4, 5); /* Finding NUL. */ in test_strrchr()
563 (void) strcpy (one, "ababa"); in test_strrchr()
564 check (strrchr (one, 'b') == one+3, 6); /* Finding last. */ in test_strrchr()
565 (void) strcpy (one, ""); in test_strrchr()
566 check (strrchr (one, 'b') == NULL, 7); /* Empty string. */ in test_strrchr()
567 check (strrchr (one, '\0') == one, 8); /* NUL in empty string. */ in test_strrchr()
590 (void) strcpy (one, "abcd"); in test_memrchr()
591 l = strlen (one) + 1; in test_memrchr()
592 check (memrchr (one, 'c', l) == one+2, 2); /* Basic test. */ in test_memrchr()
593 check (memrchr (one, 'd', l) == one+3, 3); /* End of string. */ in test_memrchr()
594 check (memrchr (one, 'a', l) == one, 4); /* Beginning. */ in test_memrchr()
595 check (memrchr (one, '\0', l) == one+4, 5); /* Finding NUL. */ in test_memrchr()
596 (void) strcpy (one, "ababa"); in test_memrchr()
597 l = strlen (one) + 1; in test_memrchr()
598 check (memrchr (one, 'b', l) == one+3, 6); /* Finding last. */ in test_memrchr()
599 (void) strcpy (one, ""); in test_memrchr()
600 l = strlen (one) + 1; in test_memrchr()
601 check (memrchr (one, 'b', l) == NULL, 7); /* Empty string. */ in test_memrchr()
602 check (memrchr (one, '\0', l) == one, 8); /* NUL in empty string. */ in test_memrchr()
636 (void) strcpy (one, "abcd"); in test_rindex()
637 check (rindex (one, 'c') == one+2, 2); /* Basic test. */ in test_rindex()
638 check (rindex (one, 'd') == one+3, 3); /* End of string. */ in test_rindex()
639 check (rindex (one, 'a') == one, 4); /* Beginning. */ in test_rindex()
640 check (rindex (one, '\0') == one+4, 5); /* Finding NUL. */ in test_rindex()
641 (void) strcpy (one, "ababa"); in test_rindex()
642 check (rindex (one, 'b') == one+3, 6); /* Finding last. */ in test_rindex()
643 (void) strcpy (one, ""); in test_rindex()
644 check (rindex (one, 'b') == NULL, 7); /* Empty string. */ in test_rindex()
645 check (rindex (one, '\0') == one, 8); /* NUL in empty string. */ in test_rindex()
653 (void) strcpy(one, "abcd"); in test_strpbrk()
654 check(strpbrk(one, "c") == one+2, 2); /* Basic test. */ in test_strpbrk()
655 check(strpbrk(one, "d") == one+3, 3); /* End of string. */ in test_strpbrk()
656 check(strpbrk(one, "a") == one, 4); /* Beginning. */ in test_strpbrk()
657 check(strpbrk(one, "") == NULL, 5); /* Empty search list. */ in test_strpbrk()
658 check(strpbrk(one, "cb") == one+1, 6); /* Multiple search. */ in test_strpbrk()
659 (void) strcpy(one, "abcabdea"); in test_strpbrk()
660 check(strpbrk(one, "b") == one+1, 7); /* Finding first. */ in test_strpbrk()
661 check(strpbrk(one, "cb") == one+1, 8); /* With multiple search. */ in test_strpbrk()
662 check(strpbrk(one, "db") == one+1, 9); /* Another variant. */ in test_strpbrk()
663 (void) strcpy(one, ""); in test_strpbrk()
664 check(strpbrk(one, "bc") == NULL, 10); /* Empty string. */ in test_strpbrk()
665 (void) strcpy(one, ""); in test_strpbrk()
666 check(strpbrk(one, "bcd") == NULL, 11); /* Empty string. */ in test_strpbrk()
667 (void) strcpy(one, ""); in test_strpbrk()
668 check(strpbrk(one, "bcde") == NULL, 12); /* Empty string. */ in test_strpbrk()
669 check(strpbrk(one, "") == NULL, 13); /* Both strings empty. */ in test_strpbrk()
670 (void) strcpy(one, "abcabdea"); in test_strpbrk()
671 check(strpbrk(one, "befg") == one+1, 14); /* Finding first. */ in test_strpbrk()
672 check(strpbrk(one, "cbr") == one+1, 15); /* With multiple search. */ in test_strpbrk()
673 check(strpbrk(one, "db") == one+1, 16); /* Another variant. */ in test_strpbrk()
674 check(strpbrk(one, "efgh") == one+6, 17); /* And yet another. */ in test_strpbrk()
683 (void) strcpy(one, "abcd"); in test_strstr()
684 check(strstr(one, "c") == one+2, 3); /* Basic test. */ in test_strstr()
685 check(strstr(one, "bc") == one+1, 4); /* Multichar. */ in test_strstr()
686 check(strstr(one, "d") == one+3, 5); /* End of string. */ in test_strstr()
687 check(strstr(one, "cd") == one+2, 6); /* Tail of string. */ in test_strstr()
688 check(strstr(one, "abc") == one, 7); /* Beginning. */ in test_strstr()
689 check(strstr(one, "abcd") == one, 8); /* Exact match. */ in test_strstr()
690 check(strstr(one, "abcde") == NULL, 9); /* Too long. */ in test_strstr()
691 check(strstr(one, "de") == NULL, 10); /* Past end. */ in test_strstr()
692 check(strstr(one, "") == one, 11); /* Finding empty. */ in test_strstr()
693 (void) strcpy(one, "ababa"); in test_strstr()
694 check(strstr(one, "ba") == one+1, 12); /* Finding first. */ in test_strstr()
695 (void) strcpy(one, ""); in test_strstr()
696 check(strstr(one, "b") == NULL, 13); /* Empty string. */ in test_strstr()
697 check(strstr(one, "") == one, 14); /* Empty in empty string. */ in test_strstr()
698 (void) strcpy(one, "bcbca"); in test_strstr()
699 check(strstr(one, "bca") == one+2, 15); /* False start. */ in test_strstr()
700 (void) strcpy(one, "bbbcabbca"); in test_strstr()
701 check(strstr(one, "bbca") == one+1, 16); /* With overlap. */ in test_strstr()
730 (void) strcpy(one, "first, second, third"); in test_strtok()
731 equal(strtok(one, ", "), "first", 1); /* Basic test. */ in test_strtok()
732 equal(one, "first", 2); in test_strtok()
736 (void) strcpy(one, ", first, "); in test_strtok()
737 equal(strtok(one, ", "), "first", 6); /* Extra delims, 1 tok. */ in test_strtok()
739 (void) strcpy(one, "1a, 1b; 2a, 2b"); in test_strtok()
740 equal(strtok(one, ", "), "1a", 8); /* Changing delim lists. */ in test_strtok()
747 (void) strcpy(one, "a,b, c,, ,d"); in test_strtok()
748 equal(strtok(one, ", "), "a", 14); /* Different separators. */ in test_strtok()
754 (void) strcpy(one, ", "); in test_strtok()
755 check(strtok(one, ", ") == NULL, 20); /* No tokens. */ in test_strtok()
756 (void) strcpy(one, ""); in test_strtok()
757 check(strtok(one, ", ") == NULL, 21); /* Empty string. */ in test_strtok()
758 (void) strcpy(one, "abc"); in test_strtok()
759 equal(strtok(one, ", "), "abc", 22); /* No delimiters. */ in test_strtok()
761 (void) strcpy(one, "abc"); in test_strtok()
762 equal(strtok(one, ""), "abc", 24); /* Empty delimiter list. */ in test_strtok()
764 (void) strcpy(one, "abcdefgh"); in test_strtok()
765 (void) strcpy(one, "a,b,c"); in test_strtok()
766 equal(strtok(one, ","), "a", 26); /* Basics again... */ in test_strtok()
770 equal(one+6, "gh", 30); /* Stomped past end? */ in test_strtok()
771 equal(one, "a", 31); /* Stomped old tokens? */ in test_strtok()
772 equal(one+2, "b", 32); in test_strtok()
773 equal(one+4, "c", 33); in test_strtok()
780 (void) strcpy(one, "first, second, third"); in test_strtok_r()
782 equal(strtok_r(one, ", ", &cp), "first", 1); /* Basic test. */ in test_strtok_r()
783 equal(one, "first", 2); in test_strtok_r()
787 (void) strcpy(one, ", first, "); in test_strtok_r()
789 equal(strtok_r(one, ", ", &cp), "first", 6); /* Extra delims, 1 tok. */ in test_strtok_r()
791 (void) strcpy(one, "1a, 1b; 2a, 2b"); in test_strtok_r()
793 equal(strtok_r(one, ", ", &cp), "1a", 8); /* Changing delim lists. */ in test_strtok_r()
801 (void) strcpy(one, "a,b, c,, ,d"); in test_strtok_r()
803 equal(strtok_r(one, ", ", &cp), "a", 14); /* Different separators. */ in test_strtok_r()
809 (void) strcpy(one, ", "); in test_strtok_r()
811 check(strtok_r(one, ", ", &cp) == NULL, 20); /* No tokens. */ in test_strtok_r()
812 (void) strcpy(one, ""); in test_strtok_r()
814 check(strtok_r(one, ", ", &cp) == NULL, 21); /* Empty string. */ in test_strtok_r()
816 (void) strcpy(one, "abc"); in test_strtok_r()
818 equal(strtok_r(one, ", ", &cp), "abc", 23); /* No delimiters. */ in test_strtok_r()
820 (void) strcpy(one, "abc"); in test_strtok_r()
822 equal(strtok_r(one, "", &cp), "abc", 25); /* Empty delimiter list. */ in test_strtok_r()
824 (void) strcpy(one, "abcdefgh"); in test_strtok_r()
825 (void) strcpy(one, "a,b,c"); in test_strtok_r()
827 equal(strtok_r(one, ",", &cp), "a", 27); /* Basics again... */ in test_strtok_r()
831 equal(one+6, "gh", 31); /* Stomped past end? */ in test_strtok_r()
832 equal(one, "a", 32); /* Stomped old tokens? */ in test_strtok_r()
833 equal(one+2, "b", 33); in test_strtok_r()
834 equal(one+4, "c", 34); in test_strtok_r()
842 cp = strcpy(one, "first, second, third"); in test_strsep()
844 equal(one, "first", 2); in test_strsep()
850 cp = strcpy(one, ", first, "); in test_strsep()
857 cp = strcpy(one, "1a, 1b; 2a, 2b"); in test_strsep()
867 cp = strcpy(one, "a,b, c,, ,d "); in test_strsep()
879 cp = strcpy(one, ", "); in test_strsep()
884 cp = strcpy(one, ""); in test_strsep()
887 cp = strcpy(one, "abc"); in test_strsep()
890 cp = strcpy(one, "abc"); in test_strsep()
893 (void) strcpy(one, "abcdefgh"); in test_strsep()
894 cp = strcpy(one, "a,b,c"); in test_strsep()
899 equal(one+6, "gh", 47); /* Stomped past end? */ in test_strsep()
900 equal(one, "a", 48); /* Stomped old tokens? */ in test_strsep()
901 equal(one+2, "b", 49); in test_strsep()
902 equal(one+4, "c", 50); in test_strsep()
916 cp = strcpy(one, "a,b, c,, ,d,"); in test_strsep()
927 cp = strcpy(one, "a,b, c,, ,d,"); in test_strsep()
938 cp = strcpy(one, "ABC"); in test_strsep()
939 one[4] = ':'; in test_strsep()
943 check(ptr == one + 3, 76); in test_strsep()
946 cp = strcpy(one, "ABC"); in test_strsep()
947 one[4] = ':'; in test_strsep()
951 check(ptr == one + 3, 80); in test_strsep()
953 cp = strcpy(one, "ABC"); /* No token in string. */ in test_strsep()
957 *one = '\0'; /* Empty string. */ in test_strsep()
958 cp = one; in test_strsep()
961 check(ptr == one, 84); in test_strsep()
964 *one = '\0'; /* Empty string and no token. */ in test_strsep()
965 cp = one; in test_strsep()
968 check(ptr == one , 87); in test_strsep()
991 (void) strcpy(one, "abcd"); in test_memchr()
992 check(memchr(one, 'c', 4) == one+2, 2); /* Basic test. */ in test_memchr()
993 check(memchr(one, ~0xff|'c', 4) == one+2, 2); /* ignore highorder bits. */ in test_memchr()
994 check(memchr(one, 'd', 4) == one+3, 3); /* End of string. */ in test_memchr()
995 check(memchr(one, 'a', 4) == one, 4); /* Beginning. */ in test_memchr()
996 check(memchr(one, '\0', 5) == one+4, 5); /* Finding NUL. */ in test_memchr()
997 (void) strcpy(one, "ababa"); in test_memchr()
998 check(memchr(one, 'b', 5) == one+1, 6); /* Finding first. */ in test_memchr()
999 check(memchr(one, 'b', 0) == NULL, 7); /* Zero count. */ in test_memchr()
1000 check(memchr(one, 'a', 1) == one, 8); /* Singleton case. */ in test_memchr()
1001 (void) strcpy(one, "a\203b"); in test_memchr()
1002 check(memchr(one, 0203, 3) == one+1, 9); /* Unsignedness. */ in test_memchr()
1034 check(memcpy(one, "abc", 4) == one, 1); /* Returned value. */ in test_memcpy()
1035 equal(one, "abc", 2); /* Did the copy go right? */ in test_memcpy()
1037 (void) strcpy(one, "abcdefgh"); in test_memcpy()
1038 (void) memcpy(one+1, "xyz", 2); in test_memcpy()
1039 equal(one, "axydefgh", 3); /* Basic test. */ in test_memcpy()
1041 (void) strcpy(one, "abc"); in test_memcpy()
1042 (void) memcpy(one, "xyz", 0); in test_memcpy()
1043 equal(one, "abc", 4); /* Zero-length copy. */ in test_memcpy()
1045 (void) strcpy(one, "hi there"); in test_memcpy()
1047 (void) memcpy(two, one, 9); in test_memcpy()
1049 equal(one, "hi there", 6); /* Stomped on source? */ in test_memcpy()
1054 strcpy (one, x); in test_memcpy()
1055 check (memcpy (one + i, "hi there", 9) == one + i, in test_memcpy()
1057 check (memcmp (one, x, i) == 0, 8 + (i * 6)); /* Wrote under? */ in test_memcpy()
1058 equal (one + i, "hi there", 9 + (i * 6)); in test_memcpy()
1059 check (one[i + 9] == 'x', 10 + (i * 6)); /* Wrote over? */ in test_memcpy()
1060 check (memcpy (two, one + i, 9) == two, in test_memcpy()
1072 check(mempcpy(one, "abc", 4) == one + 4, 1); /* Returned value. */ in test_mempcpy()
1073 equal(one, "abc", 2); /* Did the copy go right? */ in test_mempcpy()
1075 (void) strcpy(one, "abcdefgh"); in test_mempcpy()
1076 (void) mempcpy(one+1, "xyz", 2); in test_mempcpy()
1077 equal(one, "axydefgh", 3); /* Basic test. */ in test_mempcpy()
1079 (void) strcpy(one, "abc"); in test_mempcpy()
1080 (void) mempcpy(one, "xyz", 0); in test_mempcpy()
1081 equal(one, "abc", 4); /* Zero-length copy. */ in test_mempcpy()
1083 (void) strcpy(one, "hi there"); in test_mempcpy()
1085 (void) mempcpy(two, one, 9); in test_mempcpy()
1087 equal(one, "hi there", 6); /* Stomped on source? */ in test_mempcpy()
1092 strcpy (one, x); in test_mempcpy()
1093 check (mempcpy (one + i, "hi there", 9) == one + i + 9, in test_mempcpy()
1095 check (memcmp (one, x, i) == 0, 8 + (i * 6)); /* Wrote under? */ in test_mempcpy()
1096 equal (one + i, "hi there", 9 + (i * 6)); in test_mempcpy()
1097 check (one[i + 9] == 'x', 10 + (i * 6)); /* Wrote over? */ in test_mempcpy()
1098 check (mempcpy (two, one + i, 9) == two + 9, in test_mempcpy()
1109 check(memmove(one, "abc", 4) == one, 1); /* Returned value. */ in test_memmove()
1110 equal(one, "abc", 2); /* Did the copy go right? */ in test_memmove()
1112 (void) strcpy(one, "abcdefgh"); in test_memmove()
1113 (void) memmove(one+1, "xyz", 2); in test_memmove()
1114 equal(one, "axydefgh", 3); /* Basic test. */ in test_memmove()
1116 (void) strcpy(one, "abc"); in test_memmove()
1117 (void) memmove(one, "xyz", 0); in test_memmove()
1118 equal(one, "abc", 4); /* Zero-length copy. */ in test_memmove()
1120 (void) strcpy(one, "hi there"); in test_memmove()
1122 (void) memmove(two, one, 9); in test_memmove()
1124 equal(one, "hi there", 6); /* Stomped on source? */ in test_memmove()
1126 (void) strcpy(one, "abcdefgh"); in test_memmove()
1127 (void) memmove(one+1, one, 9); in test_memmove()
1128 equal(one, "aabcdefgh", 7); /* Overlap, right-to-left. */ in test_memmove()
1130 (void) strcpy(one, "abcdefgh"); in test_memmove()
1131 (void) memmove(one+1, one+2, 7); in test_memmove()
1132 equal(one, "acdefgh", 8); /* Overlap, left-to-right. */ in test_memmove()
1134 (void) strcpy(one, "abcdefgh"); in test_memmove()
1135 (void) memmove(one, one, 9); in test_memmove()
1136 equal(one, "abcdefgh", 9); /* 100% overlap. */ in test_memmove()
1147 check(memccpy(one, "abc", 'q', 4) == NULL, 1); /* Returned value. */ in test_memccpy()
1148 equal(one, "abc", 2); /* Did the copy go right? */ in test_memccpy()
1150 (void) strcpy(one, "abcdefgh"); in test_memccpy()
1151 (void) memccpy(one+1, "xyz", 'q', 2); in test_memccpy()
1152 equal(one, "axydefgh", 3); /* Basic test. */ in test_memccpy()
1154 (void) strcpy(one, "abc"); in test_memccpy()
1155 (void) memccpy(one, "xyz", 'q', 0); in test_memccpy()
1156 equal(one, "abc", 4); /* Zero-length copy. */ in test_memccpy()
1158 (void) strcpy(one, "hi there"); in test_memccpy()
1160 (void) memccpy(two, one, 'q', 9); in test_memccpy()
1162 equal(one, "hi there", 6); /* Stomped on source? */ in test_memccpy()
1164 (void) strcpy(one, "abcdefgh"); in test_memccpy()
1166 check(memccpy(two, one, 'f', 9) == two+6, 7); /* Returned value. */ in test_memccpy()
1167 equal(one, "abcdefgh", 8); /* Source intact? */ in test_memccpy()
1170 (void) strcpy(one, "abcd"); in test_memccpy()
1172 check(memccpy(two, one, 'a', 4) == two+1, 10); /* First char. */ in test_memccpy()
1174 check(memccpy(two, one, 'd', 4) == two+4, 12); /* Last char. */ in test_memccpy()
1176 (void) strcpy(one, "xyz"); in test_memccpy()
1177 check(memccpy(two, one, 'x', 1) == two+1, 14); /* Singleton. */ in test_memccpy()
1187 (void) strcpy(one, "abcdefgh"); in test_memset()
1188 check(memset(one+1, 'x', 3) == one+1, 1); /* Return value. */ in test_memset()
1189 equal(one, "axxxefgh", 2); /* Basic test. */ in test_memset()
1191 (void) memset(one+2, 'y', 0); in test_memset()
1192 equal(one, "axxxefgh", 3); /* Zero-length set. */ in test_memset()
1194 (void) memset(one+5, 0, 1); in test_memset()
1195 equal(one, "axxxe", 4); /* Zero fill. */ in test_memset()
1196 equal(one+6, "gh", 5); /* And the leftover. */ in test_memset()
1198 (void) memset(one+2, 010045, 1); in test_memset()
1199 equal(one, "ax\045xe", 6); /* Unsigned char convert. */ in test_memset()
1202 memset (one, 0x101, sizeof (one)); in test_memset()
1203 for (i = 0; i < (int) sizeof (one); ++i) in test_memset()
1204 check (one[i] == '\01', 7); in test_memset()
1249 (void) bcopy("abc", one, 4); in test_bcopy()
1250 equal(one, "abc", 1); /* Simple copy. */ in test_bcopy()
1252 (void) strcpy(one, "abcdefgh"); in test_bcopy()
1253 (void) bcopy("xyz", one+1, 2); in test_bcopy()
1254 equal(one, "axydefgh", 2); /* Basic test. */ in test_bcopy()
1256 (void) strcpy(one, "abc"); in test_bcopy()
1257 (void) bcopy("xyz", one, 0); in test_bcopy()
1258 equal(one, "abc", 3); /* Zero-length copy. */ in test_bcopy()
1260 (void) strcpy(one, "hi there"); in test_bcopy()
1262 (void) bcopy(one, two, 9); in test_bcopy()
1264 equal(one, "hi there", 5); /* Stomped on source? */ in test_bcopy()
1271 (void) strcpy(one, "abcdef"); in test_bzero()
1272 bzero(one+2, 2); in test_bzero()
1273 equal(one, "ab", 1); /* Basic test. */ in test_bzero()
1274 equal(one+3, "", 2); in test_bzero()
1275 equal(one+4, "ef", 3); in test_bzero()
1277 (void) strcpy(one, "abcdef"); in test_bzero()
1278 bzero(one+2, 0); in test_bzero()
1279 equal(one, "abcdef", 4); /* Zero-length copy. */ in test_bzero()
1382 (void) strcpy(one, "abCd"); in test_strcasestr()
1383 check(strcasestr(one, "c") == one+2, 3); /* Basic test. */ in test_strcasestr()
1384 check(strcasestr(one, "Bc") == one+1, 4); /* Multichar. */ in test_strcasestr()
1385 check(strcasestr(one, "d") == one+3, 5); /* End of string. */ in test_strcasestr()
1386 check(strcasestr(one, "Cd") == one+2, 6); /* Tail of string. */ in test_strcasestr()
1387 check(strcasestr(one, "aBc") == one, 7); /* Beginning. */ in test_strcasestr()
1388 check(strcasestr(one, "aBcd") == one, 8); /* Exact match. */ in test_strcasestr()
1389 check(strcasestr(one, "AbcDe") == NULL, 9); /* Too long. */ in test_strcasestr()
1390 check(strcasestr(one, "dE") == NULL, 10); /* Past end. */ in test_strcasestr()
1391 check(strcasestr(one, "") == one, 11); /* Finding empty. */ in test_strcasestr()
1392 (void) strcpy(one, "abAba"); in test_strcasestr()
1393 check(strcasestr(one, "Ba") == one+1, 12); /* Finding first. */ in test_strcasestr()
1394 (void) strcpy(one, ""); in test_strcasestr()
1395 check(strcasestr(one, "b") == NULL, 13); /* Empty string. */ in test_strcasestr()
1396 check(strcasestr(one, "") == one, 14); /* Empty in empty string. */ in test_strcasestr()
1397 (void) strcpy(one, "BcbCa"); in test_strcasestr()
1398 check(strcasestr(one, "bCa") == one+2, 15); /* False start. */ in test_strcasestr()
1399 (void) strcpy(one, "bbBcaBbcA"); in test_strcasestr()
1400 check(strcasestr(one, "bbCa") == one+1, 16); /* With overlap. */ in test_strcasestr()