diff options
-rw-r--r-- | test/tfile.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/test/tfile.c b/test/tfile.c index 83951ff..69136b7 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -106,7 +106,7 @@ test_file_create(void) MESSAGE(5, ("Testing Low-Level File Creation I/O\n")); /* First ensure the file does not exist */ - remove(FILE1); + HDremove(FILE1); /* Try opening a non-existant file */ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); @@ -123,14 +123,19 @@ test_file_create(void) * try to create the same file with H5F_ACC_TRUNC. This should fail * because fid1 is the same file and is currently open. */ +#ifndef H5_HAVE_FILE_VERSIONS fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); +#endif /*H5_DONT_HAVE_FILE_VERSIONS*/ /* Close all files */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); + +#ifndef H5_HAVE_FILE_VERSIONS ret = H5Fclose(fid2); VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */ +#endif /*H5_HAVE_FILE_VERSIONS*/ /* * Try again with H5F_ACC_EXCL. This should fail because the file already @@ -143,6 +148,7 @@ test_file_create(void) fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fcreate"); +#ifndef H5_HAVE_FILE_VERSIONS /* * Try to truncate first file again. This should fail because fid1 is the * same file and is currently open. @@ -156,6 +162,7 @@ test_file_create(void) */ fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); VERIFY(fid2, FAIL, "H5Fcreate"); +#endif /*H5_HAVE_FILE_VERSIONS*/ /* Get the file-creation template */ tmpl1 = H5Fget_create_plist(fid1); @@ -1122,6 +1129,7 @@ test_file_perm(void) ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); +#ifndef H5_CANNOT_OPEN_TWICE /* Open the file (with read-only permission) */ filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(filero, FAIL, "H5Fopen"); @@ -1138,6 +1146,7 @@ test_file_perm(void) ret = H5Fclose(filero); CHECK(ret, FAIL, "H5Fclose"); +#endif /*H5_CANNOT_OPEN_TWICE*/ ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); @@ -1826,12 +1835,16 @@ test_file(void) test_file_freespace(); /* Test file free space information */ test_file_ishdf5(); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ +#ifndef H5_CANNOT_OPEN_TWICE test_file_open_overlap(); /* Test opening files in an overlapping manner */ +#endif /*H5_CANNOT_OPEN_TWICE*/ test_file_getname(); /* Test basic H5Fget_name() functionality */ +#ifndef H5_CANNOT_OPEN_TWICE test_file_double_root_open(); /* Test opening root group from two files works properly */ test_file_double_group_open(); /* Test opening same group from two files works properly */ test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */ test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */ +#endif /*H5_CANNOT_OPEN_TWICE*/ } /* test_file() */ @@ -1852,8 +1865,8 @@ test_file(void) void cleanup_file(void) { - remove(FILE1); - remove(FILE2); - remove(FILE3); - remove(FILE4); + HDremove(FILE1); + HDremove(FILE2); + HDremove(FILE3); + HDremove(FILE4); } |