Home | History | Annotate | Download | only in tests

Lines Matching refs:equal

58 /* Complain if first two args don't strcmp as equal.  */
60 equal (const char *a, const char *b, int number)
137 equal (one, "abcd", 2); /* Basic test. */
140 equal (one, "x", 3); /* Writeover. */
141 equal (one+2, "cd", 4); /* Wrote too much? */
145 equal (one, "hi there", 5); /* Basic test encore. */
146 equal (two, "hi there", 6); /* Stomped on source? */
149 equal (one, "", 7); /* Boundary condition. */
154 equal (one + i, "hi there", 8 + (i * 2));
156 equal (two, "hi there", 9 + (i * 2));
181 equal (dst, "frobozz", 2);
190 equal (one, "a", 2);
193 equal (one, "ab", 4);
196 equal (one, "abc", 6);
199 equal (one, "abcd", 8);
202 equal (one, "abcde", 10);
205 equal (one, "abcdef", 12);
208 equal (one, "abcdefg", 14);
211 equal (one, "abcdefgh", 16);
214 equal (one, "abcdefghi", 18);
217 equal (one, "x", 20); /* Writeover. */
218 equal (one+2, "cdefghi", 21); /* Wrote too much? */
221 equal (one, "xx", 23); /* Writeover. */
222 equal (one+3, "defghi", 24); /* Wrote too much? */
225 equal (one, "xxx", 26); /* Writeover. */
226 equal (one+4, "efghi", 27); /* Wrote too much? */
229 equal (one, "xxxx", 29); /* Writeover. */
230 equal (one+5, "fghi", 30); /* Wrote too much? */
233 equal (one, "xxxxx", 32); /* Writeover. */
234 equal (one+6, "ghi", 33); /* Wrote too much? */
237 equal (one, "xxxxxx", 35); /* Writeover. */
238 equal (one+7, "hi", 36); /* Wrote too much? */
241 equal (one, "xxxxxxx", 38); /* Writeover. */
242 equal (one+8, "i", 39); /* Wrote too much? */
245 equal (one, "abc", 41);
246 equal (one + 4, "xxx", 42);
291 equal (one, "ijklmn", 2); /* Basic test. */
295 equal (one, "xyz", 3); /* Writeover. */
296 equal (one+4, "mn", 4); /* Wrote too much? */
301 equal (one, "ghef", 5); /* Basic test encore. */
302 equal (two, "ef", 6); /* Stomped on source? */
306 equal (one, "", 7); /* Boundary conditions. */
309 equal (one, "ab", 8);
312 equal (one, "cd", 9);
323 equal (one, "ijklmn", 2); /* Basic test. */
327 equal (one, "xyz", 3); /* Writeover. */
328 equal (one+4, "mn", 4); /* Wrote too much? */
333 equal (one, "ghef", 5); /* Basic test encore. */
334 equal (two, "ef", 6); /* Stomped on source? */
338 equal (one, "", 7); /* Boundary conditions. */
341 equal (one, "ab", 8);
344 equal (one, "cd", 9);
348 equal (one, "abcd", 10); /* Count-limited. */
351 equal (one, "abcd", 11); /* Zero count. */
354 equal (one, "abcdgh", 12); /* Count and length equal. */
383 equal (one, "abc", 2); /* Did the copy go right? */
387 equal (one, "xycdefgh", 3); /* Copy cut by count. */
391 equal (one, "xyzdefgh", 4);
395 equal (one, "xyz", 5);
396 equal (one+4, "efgh", 6); /* Wrote too much? */
400 equal (one, "xyz", 7);
401 equal (one+4, "", 8);
402 equal (one+5, "fgh", 9);
406 equal (one, "abc", 10);
409 equal (one, "", 11);
410 equal (one+1, "", 12);
411 equal (one+2, "c", 13);
415 equal (two, "hi there", 14); /* Just paranoia. */
416 equal (one, "hi there", 15); /* Stomped on source? */
731 equal(strtok(one, ", "), "first", 1); /* Basic test. */
732 equal(one, "first", 2);
733 equal(strtok((char *)NULL, ", "), "second", 3);
734 equal(strtok((char *)NULL, ", "), "third", 4);
737 equal(strtok(one, ", "), "first", 6); /* Extra delims, 1 tok. */
740 equal(strtok(one, ", "), "1a", 8); /* Changing delim lists. */
741 equal(strtok((char *)NULL, "; "), "1b", 9);
742 equal(strtok((char *)NULL, ", "), "2a", 10);
744 equal(strtok(two, "-"), "x", 11); /* New string before done. */
745 equal(strtok((char *)NULL, "-"), "y", 12);
748 equal(strtok(one, ", "), "a", 14); /* Different separators. */
749 equal(strtok((char *)NULL, ", "), "b", 15);
750 equal(strtok((char *)NULL, " ,"), "c", 16); /* Permute list too. */
751 equal(strtok((char *)NULL, " ,"), "d", 17);
759 equal(strtok(one, ", "), "abc", 22); /* No delimiters. */
762 equal(strtok(one, ""), "abc", 24); /* Empty delimiter list. */
766 equal(strtok(one, ","), "a", 26); /* Basics again... */
767 equal(strtok((char *)NULL, ","), "b", 27);
768 equal(strtok((char *)NULL, ","), "c", 28);
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);
782 equal(strtok_r(one, ", ", &cp), "first", 1); /* Basic test. */
783 equal(one, "first", 2);
784 equal(strtok_r((char *)NULL, ", ", &cp), "second", 3);
785 equal(strtok_r((char *)NULL, ", ", &cp), "third", 4);
789 equal(strtok_r(one, ", ", &cp), "first", 6); /* Extra delims, 1 tok. */
793 equal(strtok_r(one, ", ", &cp), "1a", 8); /* Changing delim lists. */
794 equal(strtok_r((char *)NULL, "; ", &cp), "1b", 9);
795 equal(strtok_r((char *)NULL, ", ", &cp), "2a", 10);
798 equal(strtok_r(two, "-", &cp), "x", 11); /* New string before done. */
799 equal(strtok_r((char *)NULL, "-", &cp), "y", 12);
803 equal(strtok_r(one, ", ", &cp), "a", 14); /* Different separators. */
804 equal(strtok_r((char *)NULL, ", ", &cp), "b", 15);
805 equal(strtok_r((char *)NULL, " ,", &cp), "c", 16); /* Permute list too. */
806 equal(strtok_r((char *)NULL, " ,", &cp), "d", 17);
818 equal(strtok_r(one, ", ", &cp), "abc", 23); /* No delimiters. */
822 equal(strtok_r(one, "", &cp), "abc", 25); /* Empty delimiter list. */
827 equal(strtok_r(one, ",", &cp), "a", 27); /* Basics again... */
828 equal(strtok_r((char *)NULL, ",", &cp), "b", 28);
829 equal(strtok_r((char *)NULL, ",", &cp), "c", 29);
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);
843 equal(strsep(&cp, ", "), "first", 1); /* Basic test. */
844 equal(one, "first", 2);
845 equal(strsep(&cp, ", "), "", 3);
846 equal(strsep(&cp, ", "), "second", 4);
847 equal(strsep(&cp, ", "), "", 5);
848 equal(strsep(&cp, ", "), "third", 6);
851 equal(strsep(&cp, ", "), "", 8);
852 equal(strsep(&cp, ", "), "", 9);
853 equal(strsep(&cp, ", "), "first", 10); /* Extra delims, 1 tok. */
854 equal(strsep(&cp, ", "), "", 11);
855 equal(strsep(&cp, ", "), "", 12);
858 equal(strsep(&cp, ", "), "1a", 14); /* Changing delim lists. */
859 equal(strsep(&cp, ", "), "", 15);
860 equal(strsep(&cp, "; "), "1b", 16);
861 equal(strsep(&cp, ", "), "", 17);
862 equal(strsep(&cp, ", "), "2a", 18);
864 equal(strsep(&cp, "-"), "x", 19); /* New string before done. */
865 equal(strsep(&cp, "-"), "y", 20);
868 equal(strsep(&cp, ", "), "a", 22); /* Different separators. */
869 equal(strsep(&cp, ", "), "b", 23);
870 equal(strsep(&cp, " ,"), "", 24);
871 equal(strsep(&cp, " ,"), "c", 25); /* Permute list too. */
872 equal(strsep(&cp, " ,"), "", 26);
873 equal(strsep(&cp, " ,"), "", 27);
874 equal(strsep(&cp, " ,"), "", 28);
875 equal(strsep(&cp, " ,"), "d", 29);
876 equal(strsep(&cp, " ,"), "", 30);
880 equal(strsep(&cp, ", "), "", 33);
881 equal(strsep(&cp, ", "), "", 34);
882 equal(strsep(&cp, ", "), "", 35);
885 equal(strsep(&cp, ", "), "", 37);
888 equal(strsep(&cp, ", "), "abc", 39); /* No delimiters. */
891 equal(strsep(&cp, ""), "abc", 41); /* Empty delimiter list. */
895 equal(strsep(&cp, ","), "a", 43); /* Basics again... */
896 equal(strsep(&cp, ","), "b", 44);
897 equal(strsep(&cp, ","), "c", 45);
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);
908 equal (strsep (&list, ","), "This", 51);
909 equal (strsep (&list, ","), "is", 52);
910 equal (strsep (&list, ","), "a", 53);
911 equal (strsep (&list, ","), "test", 54);
917 equal(strsep(&cp, ","), "a", 56); /* Different separators. */
918 equal(strsep(&cp, ","), "b", 57);
919 equal(strsep(&cp, ","), " c", 58); /* Permute list too. */
920 equal(strsep(&cp, ","), "", 59);
921 equal(strsep(&cp, ","), " ", 60);
922 equal(strsep(&cp, ","), "d", 61);
923 equal(strsep(&cp, ","), "", 62);
928 equal(strsep(&cp, "xy,"), "a", 65); /* Different separators. */
929 equal(strsep(&cp, "x,y"), "b", 66);
930 equal(strsep(&cp, ",xy"), " c", 67); /* Permute list too. */
931 equal(strsep(&cp, "xy,"), "", 68);
932 equal(strsep(&cp, "x,y"), " ", 69);
933 equal(strsep(&cp, ",xy"), "d", 70);
934 equal(strsep(&cp, "xy,"), "", 71);
940 equal(strsep(&cp, "C"), "AB", 74); /* Access beyond NUL. */
942 equal(ptr, "", 75);
948 equal(strsep(&cp, "CD"), "AB", 78); /* Access beyond NUL. */
950 equal(ptr, "", 79);
954 equal(strsep(&cp, ","), "ABC", 81);
960 equal(ptr, "", 83);
967 equal(ptr, "", 86);
1035 equal(one, "abc", 2); /* Did the copy go right? */
1039 equal(one, "axydefgh", 3); /* Basic test. */
1043 equal(one, "abc", 4); /* Zero-length copy. */
1048 equal(two, "hi there", 5); /* Just paranoia. */
1049 equal(one, "hi there", 6); /* Stomped on source? */
1058 equal (one + i, "hi there", 9 + (i * 6));
1062 equal (two, "hi there", 12 + (i * 6));
1073 equal(one, "abc", 2); /* Did the copy go right? */
1077 equal(one, "axydefgh", 3); /* Basic test. */
1081 equal(one, "abc", 4); /* Zero-length copy. */
1086 equal(two, "hi there", 5); /* Just paranoia. */
1087 equal(one, "hi there", 6); /* Stomped on source? */
1096 equal (one + i, "hi there", 9 + (i * 6));
1100 equal (two, "hi there", 12 + (i * 6));
1110 equal(one, "abc", 2); /* Did the copy go right? */
1114 equal(one, "axydefgh", 3); /* Basic test. */
1118 equal(one, "abc", 4); /* Zero-length copy. */
1123 equal(two, "hi there", 5); /* Just paranoia. */
1124 equal(one, "hi there", 6); /* Stomped on source? */
1128 equal(one, "aabcdefgh", 7); /* Overlap, right-to-left. */
1132 equal(one, "acdefgh", 8); /* Overlap, left-to-right. */
1136 equal(one, "abcdefgh", 9); /* 100% overlap. */
1148 equal(one, "abc", 2); /* Did the copy go right? */
1152 equal(one, "axydefgh", 3); /* Basic test. */
1156 equal(one, "abc", 4); /* Zero-length copy. */
1161 equal(two, "hi there", 5); /* Just paranoia. */
1162 equal(one, "hi there", 6); /* Stomped on source? */
1167 equal(one, "abcdefgh", 8); /* Source intact? */
1168 equal(two, "abcdefeathers", 9); /* Copy correct? */
1173 equal(two, "aumblebee", 11);
1175 equal(two, "abcdlebee", 13);
1178 equal(two, "xbcdlebee", 15);
1189 equal(one, "axxxefgh", 2); /* Basic test. */
1192 equal(one, "axxxefgh", 3); /* Zero-length set. */
1195 equal(one, "axxxe", 4); /* Zero fill. */
1196 equal(one+6, "gh", 5); /* And the leftover. */
1199 equal(one, "ax\045xe", 6); /* Unsigned char convert. */
1250 equal(one, "abc", 1); /* Simple copy. */
1254 equal(one, "axydefgh", 2); /* Basic test. */
1258 equal(one, "abc", 3); /* Zero-length copy. */
1263 equal(two, "hi there", 4); /* Just paranoia. */
1264 equal(one, "hi there", 5); /* Stomped on source? */
1273 equal(one, "ab", 1); /* Basic test. */
1274 equal(one+3, "", 2);
1275 equal(one+4, "ef", 3);
1279 equal(one, "abcdef", 4); /* Zero-length copy. */
1292 equal(p, "abcdef", 2);
1296 equal(q, "bc", 4);
1303 equal(p, "abc", 6);