Changeset 988 for vendor/current/lib/replace/test
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/lib/replace/test
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/replace/test/getifaddrs.c
r860 r988 27 27 #include "replace.h" 28 28 #include "system/network.h" 29 #include "replace-test.h" 29 30 #endif 30 31 -
vendor/current/lib/replace/test/main.c
r414 r988 25 25 26 26 #include "replace.h" 27 28 struct torture_context; 29 bool torture_local_replace(struct torture_context *ctx); 27 #include "replace-testsuite.h" 30 28 31 29 int main(void) -
vendor/current/lib/replace/test/os2_delete.c
r740 r988 13 13 #include <string.h> 14 14 #include <fcntl.h> 15 #include "replace-test.h" 15 16 16 17 #define NUM_FILES 700 … … 22 23 static int test_readdir_os2_delete_ret; 23 24 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) 25 26 26 27 #ifndef MIN … … 70 71 de=readdir(d), i++) { 71 72 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); 73 75 } 74 76 -
vendor/current/lib/replace/test/strptime.c
r414 r988 20 20 #include "replace.h" 21 21 #include "system/time.h" 22 #include "replace-test.h" 22 23 23 24 #endif /* LIBREPLACE_CONFIGURE_TEST_STRPTIME */ -
vendor/current/lib/replace/test/testsuite.c
r740 r988 25 25 26 26 #include "replace.h" 27 #include "replace-test.h" 28 #include "replace-testsuite.h" 27 29 28 30 /* … … 49 51 #define TESTFILE "testfile.dat" 50 52 53 51 54 /* 52 55 test ftruncate() function … … 67 70 if (ftruncate(fd, size) != 0) { 68 71 printf("failure: ftruncate [\n%s\n]\n", strerror(errno)); 72 close(fd); 69 73 return false; 70 74 } 71 75 if (fstat(fd, &st) != 0) { 72 76 printf("failure: ftruncate [\nfstat failed - %s\n]\n", strerror(errno)); 77 close(fd); 73 78 return false; 74 79 } … … 76 81 printf("failure: ftruncate [\ngave wrong size %d - expected %d\n]\n", 77 82 (int)st.st_size, size); 83 close(fd); 78 84 return false; 79 85 } 80 86 unlink(TESTFILE); 81 87 printf("success: ftruncate\n"); 88 close(fd); 82 89 return true; 83 90 } … … 270 277 if (strcmp(x, "bla") != 0) { 271 278 printf("failure: strndup [\ninvalid\n]\n"); 279 free(x); 272 280 return false; 273 281 } … … 377 385 } 378 386 379 extern int test_readdir_os2_delete(void);380 381 387 static int test_readdir(void) 382 388 { … … 458 464 459 465 static int test_pwrite(void) 460 {461 /* FIXME */462 return true;463 }464 465 static int test_getpass(void)466 466 { 467 467 /* FIXME */ … … 893 893 "fstat (1) failed - %s\n]\n", 894 894 strerror(errno)); 895 close(fd); 895 896 return false; 896 897 } … … 902 903 "utime(&u) failed - %s\n]\n", 903 904 strerror(errno)); 905 close(fd); 904 906 return false; 905 907 } … … 909 911 "fstat (2) failed - %s\n]\n", 910 912 strerror(errno)); 913 close(fd); 911 914 return false; 912 915 } … … 916 919 "utime(NULL) failed - %s\n]\n", 917 920 strerror(errno)); 921 close(fd); 918 922 return false; 919 923 } … … 923 927 "fstat (3) failed - %s\n]\n", 924 928 strerror(errno)); 929 close(fd); 925 930 return false; 926 931 } … … 932 937 __location__, \ 933 938 #a, (int)a, #c, #b, (int)b); \ 939 close(fd); \ 934 940 return false; \ 935 941 } \ … … 951 957 unlink(TESTFILE); 952 958 printf("success: utime\n"); 959 close(fd); 953 960 return true; 954 961 } … … 975 982 "fstat (1) failed - %s\n]\n", 976 983 strerror(errno)); 984 close(fd); 977 985 return false; 978 986 } … … 985 993 "utimes(tv) failed - %s\n]\n", 986 994 strerror(errno)); 995 close(fd); 987 996 return false; 988 997 } … … 992 1001 "fstat (2) failed - %s\n]\n", 993 1002 strerror(errno)); 1003 close(fd); 994 1004 return false; 995 1005 } … … 1001 1011 __location__, \ 1002 1012 #a, (int)a, #b, (int)b); \ 1013 close(fd); \ 1003 1014 return false; \ 1004 1015 } \ … … 1012 1023 unlink(TESTFILE); 1013 1024 printf("success: utimes\n"); 1025 close(fd); 1014 1026 return true; 1015 1027 } … … 1053 1065 1054 1066 1055 struct torture_context;1056 1067 bool torture_local_replace(struct torture_context *ctx) 1057 1068 { … … 1090 1101 ret &= test_pread(); 1091 1102 ret &= test_pwrite(); 1092 ret &= test_getpass();1093 1103 ret &= test_inet_ntoa(); 1094 1104 ret &= test_strtoll();
Note:
See TracChangeset
for help on using the changeset viewer.