Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/replace/test/testsuite.c

    r414 r745  
    752752bool
    753753socklen_t
    754 uint_t
    755754uint{8,16,32,64}_t
    756755int{8,16,32,64}_t
     
    773772        printf("test: FUNCTION\n");
    774773        if (strcmp(__FUNCTION__, "test_FUNCTION") != 0) {
    775                 printf("failure: FAILURE [\nFAILURE invalid\n]\n");
     774                printf("failure: FUNCTION [\nFUNCTION invalid\n]\n");
    776775                return false;
    777776        }
     
    10151014        return true;
    10161015}
     1016
     1017static int test_memmem(void)
     1018{
     1019        char *s;
     1020
     1021        printf("test: memmem\n");
     1022
     1023        s = (char *)memmem("foo", 3, "fo", 2);
     1024        if (strcmp(s, "foo") != 0) {
     1025                printf(__location__ ": Failed memmem\n");
     1026                return false;
     1027        }
     1028
     1029        s = (char *)memmem("foo", 3, "", 0);
     1030        /* it is allowable for this to return NULL (as happens on
     1031           FreeBSD) */
     1032        if (s && strcmp(s, "foo") != 0) {
     1033                printf(__location__ ": Failed memmem\n");
     1034                return false;
     1035        }
     1036
     1037        s = (char *)memmem("foo", 4, "o", 1);
     1038        if (strcmp(s, "oo") != 0) {
     1039                printf(__location__ ": Failed memmem\n");
     1040                return false;
     1041        }
     1042
     1043        s = (char *)memmem("foobarfodx", 11, "fod", 3);
     1044        if (strcmp(s, "fodx") != 0) {
     1045                printf(__location__ ": Failed memmem\n");
     1046                return false;
     1047        }
     1048
     1049        printf("success: memmem\n");
     1050
     1051        return true;
     1052}
     1053
    10171054
    10181055struct torture_context;
     
    10661103        ret &= test_utime();
    10671104        ret &= test_utimes();
     1105        ret &= test_memmem();
    10681106
    10691107        return ret;
Note: See TracChangeset for help on using the changeset viewer.