Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/strrstr.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/libbb/strrstr.c

    r2725 r3621  
    88 */
    99
    10 #ifdef __DO_STRRSTR_TEST
    11 #include <stdlib.h>
    12 #include <string.h>
    13 #include <stdio.h>
    14 #else
    1510#include "libbb.h"
    16 #endif
    1711
    1812/*
     
    3529}
    3630
    37 #ifdef __DO_STRRSTR_TEST
    38 int main(int argc, char **argv)
     31#if ENABLE_UNIT_TEST
     32
     33BBUNIT_DEFINE_TEST(strrstr)
    3934{
    4035    static const struct {
     
    6055    while (i < sizeof(test_array) / sizeof(test_array[0])) {
    6156        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);
    6357        if (r == NULL)
    6458            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);
    6660        i++;
    6761    }
    6862
    69     return 0;
     63    BBUNIT_ENDTEST;
    7064}
    71 #endif
     65
     66#endif /* ENABLE_UNIT_TEST */
Note: See TracChangeset for help on using the changeset viewer.