Ignore:
Timestamp:
Jul 2, 2013, 7:27:06 PM (12 years ago)
Author:
Herwig Bauernfeind
Message:

Samba Server 3.5: Update branch to 3.5.20

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/lib/replace/test/testsuite.c

    r414 r773  
    10151015        return true;
    10161016}
     1017
     1018static 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
    10171053
    10181054struct torture_context;
     
    10661102        ret &= test_utime();
    10671103        ret &= test_utimes();
     1104        ret &= test_memmem();
    10681105
    10691106        return ret;
Note: See TracChangeset for help on using the changeset viewer.