Home | History | Annotate | Download | only in tests

Lines Matching refs:one

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