Changeset 773 for branches/samba-3.5.x/lib/replace/test
- Timestamp:
- Jul 2, 2013, 7:27:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/lib/replace/test/testsuite.c
r414 r773 1015 1015 return true; 1016 1016 } 1017 1018 static int test_memmem(void) 1019 { 1020 char *s; 1021 1022 printf("test: memmem\n"); 1023 1024 s = memmem("foo", 3, "fo", 2); 1025 if (strcmp(s, "foo") != 0) { 1026 printf(__location__ ": Failed memmem\n"); 1027 return false; 1028 } 1029 1030 s = memmem("foo", 3, "", 0); 1031 if (strcmp(s, "foo") != 0) { 1032 printf(__location__ ": Failed memmem\n"); 1033 return false; 1034 } 1035 1036 s = memmem("foo", 4, "o", 1); 1037 if (strcmp(s, "oo") != 0) { 1038 printf(__location__ ": Failed memmem\n"); 1039 return false; 1040 } 1041 1042 s = memmem("foobarfodx", 11, "fod", 3); 1043 if (strcmp(s, "fodx") != 0) { 1044 printf(__location__ ": Failed memmem\n"); 1045 return false; 1046 } 1047 1048 printf("success: memmem\n"); 1049 1050 return true; 1051 } 1052 1017 1053 1018 1054 struct torture_context; … … 1066 1102 ret &= test_utime(); 1067 1103 ret &= test_utimes(); 1104 ret &= test_memmem(); 1068 1105 1069 1106 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.