Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/strrstr.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/libbb/strrstr.c
r2725 r3621 8 8 */ 9 9 10 #ifdef __DO_STRRSTR_TEST11 #include <stdlib.h>12 #include <string.h>13 #include <stdio.h>14 #else15 10 #include "libbb.h" 16 #endif17 11 18 12 /* … … 35 29 } 36 30 37 #ifdef __DO_STRRSTR_TEST 38 int main(int argc, char **argv) 31 #if ENABLE_UNIT_TEST 32 33 BBUNIT_DEFINE_TEST(strrstr) 39 34 { 40 35 static const struct { … … 60 55 while (i < sizeof(test_array) / sizeof(test_array[0])) { 61 56 const char *r = strrstr(test_array[i].h, test_array[i].n); 62 printf("'%s' vs. '%s': '%s' - ", test_array[i].h, test_array[i].n, r);63 57 if (r == NULL) 64 58 r = test_array[i].h - 1; 65 printf("%s\n", r == test_array[i].h + test_array[i].pos ? "PASSED" : "FAILED");59 BBUNIT_ASSERT_EQ(r, test_array[i].h + test_array[i].pos); 66 60 i++; 67 61 } 68 62 69 return 0;63 BBUNIT_ENDTEST; 70 64 } 71 #endif 65 66 #endif /* ENABLE_UNIT_TEST */
Note:
See TracChangeset
for help on using the changeset viewer.