Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

Location:
vendor/current/lib/replace/test
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/replace/test/getifaddrs.c

    r860 r988  
    2727#include "replace.h"
    2828#include "system/network.h"
     29#include "replace-test.h"
    2930#endif
    3031
  • vendor/current/lib/replace/test/main.c

    r414 r988  
    2525
    2626#include "replace.h"
    27 
    28 struct torture_context;
    29 bool torture_local_replace(struct torture_context *ctx);
     27#include "replace-testsuite.h"
    3028
    3129int main(void)
  • vendor/current/lib/replace/test/os2_delete.c

    r740 r988  
    1313#include <string.h>
    1414#include <fcntl.h>
     15#include "replace-test.h"
    1516
    1617#define NUM_FILES 700
     
    2223static int test_readdir_os2_delete_ret;
    2324
    24 #define FAILED(d) (printf("failure: readdir [\nFailed for %s - %d = %s\n]\n", d, errno, strerror(errno)), test_readdir_os2_delete_ret = 1, 1)
     25#define FAILED(d) (printf("failure: readdir [\nFailed for %s - %d = %s\n]\n", d, errno, strerror(errno)), test_readdir_os2_delete_ret = 1)
    2526
    2627#ifndef MIN
     
    7071             de=readdir(d), i++) {
    7172                offsets[i] = telldir(d);
    72                 strcpy(names[i], de->d_name);
     73                /* strlcpy not available here */
     74                snprintf(names[i], sizeof(names[i]), "%s", de->d_name);
    7375        }
    7476
  • vendor/current/lib/replace/test/strptime.c

    r414 r988  
    2020#include "replace.h"
    2121#include "system/time.h"
     22#include "replace-test.h"
    2223
    2324#endif /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */
  • vendor/current/lib/replace/test/testsuite.c

    r740 r988  
    2525
    2626#include "replace.h"
     27#include "replace-test.h"
     28#include "replace-testsuite.h"
    2729
    2830/*
     
    4951#define TESTFILE "testfile.dat"
    5052
     53
    5154/*
    5255  test ftruncate() function
     
    6770        if (ftruncate(fd, size) != 0) {
    6871                printf("failure: ftruncate [\n%s\n]\n", strerror(errno));
     72                close(fd);
    6973                return false;
    7074        }
    7175        if (fstat(fd, &st) != 0) {
    7276                printf("failure: ftruncate [\nfstat failed - %s\n]\n", strerror(errno));
     77                close(fd);
    7378                return false;
    7479        }
     
    7681                printf("failure: ftruncate [\ngave wrong size %d - expected %d\n]\n",
    7782                       (int)st.st_size, size);
     83                close(fd);
    7884                return false;
    7985        }
    8086        unlink(TESTFILE);
    8187        printf("success: ftruncate\n");
     88        close(fd);
    8289        return true;
    8390}
     
    270277        if (strcmp(x, "bla") != 0) {
    271278                printf("failure: strndup [\ninvalid\n]\n");
     279                free(x);
    272280                return false;
    273281        }
     
    377385}
    378386
    379 extern int test_readdir_os2_delete(void);
    380 
    381387static int test_readdir(void)
    382388{
     
    458464
    459465static int test_pwrite(void)
    460 {
    461         /* FIXME */
    462         return true;
    463 }
    464 
    465 static int test_getpass(void)
    466466{
    467467        /* FIXME */
     
    893893                       "fstat (1) failed - %s\n]\n",
    894894                       strerror(errno));
     895                close(fd);
    895896                return false;
    896897        }
     
    902903                       "utime(&u) failed - %s\n]\n",
    903904                       strerror(errno));
     905                close(fd);
    904906                return false;
    905907        }
     
    909911                       "fstat (2) failed - %s\n]\n",
    910912                       strerror(errno));
     913                close(fd);
    911914                return false;
    912915        }
     
    916919                       "utime(NULL) failed - %s\n]\n",
    917920                       strerror(errno));
     921                close(fd);
    918922                return false;
    919923        }
     
    923927                       "fstat (3) failed - %s\n]\n",
    924928                       strerror(errno));
     929                close(fd);
    925930                return false;
    926931        }
     
    932937                       __location__, \
    933938                       #a, (int)a, #c, #b, (int)b); \
     939                close(fd); \
    934940                return false; \
    935941        } \
     
    951957        unlink(TESTFILE);
    952958        printf("success: utime\n");
     959        close(fd);
    953960        return true;
    954961}
     
    975982                       "fstat (1) failed - %s\n]\n",
    976983                       strerror(errno));
     984                close(fd);
    977985                return false;
    978986        }
     
    985993                       "utimes(tv) failed - %s\n]\n",
    986994                       strerror(errno));
     995                close(fd);
    987996                return false;
    988997        }
     
    9921001                       "fstat (2) failed - %s\n]\n",
    9931002                       strerror(errno));
     1003                close(fd);
    9941004                return false;
    9951005        }
     
    10011011                       __location__, \
    10021012                       #a, (int)a, #b, (int)b); \
     1013                close(fd); \
    10031014                return false; \
    10041015        } \
     
    10121023        unlink(TESTFILE);
    10131024        printf("success: utimes\n");
     1025        close(fd);
    10141026        return true;
    10151027}
     
    10531065
    10541066
    1055 struct torture_context;
    10561067bool torture_local_replace(struct torture_context *ctx)
    10571068{
     
    10901101        ret &= test_pread();
    10911102        ret &= test_pwrite();
    1092         ret &= test_getpass();
    10931103        ret &= test_inet_ntoa();
    10941104        ret &= test_strtoll();
Note: See TracChangeset for help on using the changeset viewer.