mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r12055] Purpose: VMS port
Description: By default on VMS system file cannot be opened twice; also VMS has file versioning. This brakes some of our tests. Solution: Tests are commented out with H5_CANNOT_OPEN_TWICE and H5_HAVE_FILE_VERSIONS that are defined in the vms/h5pubconf.h file only. This change cannot affect any other platform. Platforms tested: heping, VMS server Misc. update:
This commit is contained in:
parent
3f791d1b06
commit
be337d4e20
23
test/tfile.c
23
test/tfile.c
@ -106,7 +106,7 @@ test_file_create(void)
|
|||||||
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
|
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
|
||||||
|
|
||||||
/* First ensure the file does not exist */
|
/* First ensure the file does not exist */
|
||||||
remove(FILE1);
|
HDremove(FILE1);
|
||||||
|
|
||||||
/* Try opening a non-existant file */
|
/* Try opening a non-existant file */
|
||||||
fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
|
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
|
* try to create the same file with H5F_ACC_TRUNC. This should fail
|
||||||
* because fid1 is the same file and is currently open.
|
* 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);
|
fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||||
VERIFY(fid2, FAIL, "H5Fcreate");
|
VERIFY(fid2, FAIL, "H5Fcreate");
|
||||||
|
#endif /*H5_DONT_HAVE_FILE_VERSIONS*/
|
||||||
|
|
||||||
/* Close all files */
|
/* Close all files */
|
||||||
ret = H5Fclose(fid1);
|
ret = H5Fclose(fid1);
|
||||||
CHECK(ret, FAIL, "H5Fclose");
|
CHECK(ret, FAIL, "H5Fclose");
|
||||||
|
|
||||||
|
#ifndef H5_HAVE_FILE_VERSIONS
|
||||||
ret = H5Fclose(fid2);
|
ret = H5Fclose(fid2);
|
||||||
VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */
|
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
|
* 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);
|
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||||
CHECK(fid1, FAIL, "H5Fcreate");
|
CHECK(fid1, FAIL, "H5Fcreate");
|
||||||
|
|
||||||
|
#ifndef H5_HAVE_FILE_VERSIONS
|
||||||
/*
|
/*
|
||||||
* Try to truncate first file again. This should fail because fid1 is the
|
* Try to truncate first file again. This should fail because fid1 is the
|
||||||
* same file and is currently open.
|
* same file and is currently open.
|
||||||
@ -156,6 +162,7 @@ test_file_create(void)
|
|||||||
*/
|
*/
|
||||||
fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
|
fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
|
||||||
VERIFY(fid2, FAIL, "H5Fcreate");
|
VERIFY(fid2, FAIL, "H5Fcreate");
|
||||||
|
#endif /*H5_HAVE_FILE_VERSIONS*/
|
||||||
|
|
||||||
/* Get the file-creation template */
|
/* Get the file-creation template */
|
||||||
tmpl1 = H5Fget_create_plist(fid1);
|
tmpl1 = H5Fget_create_plist(fid1);
|
||||||
@ -1122,6 +1129,7 @@ test_file_perm(void)
|
|||||||
ret = H5Dclose(dset);
|
ret = H5Dclose(dset);
|
||||||
CHECK(ret, FAIL, "H5Dclose");
|
CHECK(ret, FAIL, "H5Dclose");
|
||||||
|
|
||||||
|
#ifndef H5_CANNOT_OPEN_TWICE
|
||||||
/* Open the file (with read-only permission) */
|
/* Open the file (with read-only permission) */
|
||||||
filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT);
|
filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||||
CHECK(filero, FAIL, "H5Fopen");
|
CHECK(filero, FAIL, "H5Fopen");
|
||||||
@ -1138,6 +1146,7 @@ test_file_perm(void)
|
|||||||
|
|
||||||
ret = H5Fclose(filero);
|
ret = H5Fclose(filero);
|
||||||
CHECK(ret, FAIL, "H5Fclose");
|
CHECK(ret, FAIL, "H5Fclose");
|
||||||
|
#endif /*H5_CANNOT_OPEN_TWICE*/
|
||||||
|
|
||||||
ret = H5Fclose(file);
|
ret = H5Fclose(file);
|
||||||
CHECK(ret, FAIL, "H5Fclose");
|
CHECK(ret, FAIL, "H5Fclose");
|
||||||
@ -1826,12 +1835,16 @@ test_file(void)
|
|||||||
test_file_freespace(); /* Test file free space information */
|
test_file_freespace(); /* Test file free space information */
|
||||||
test_file_ishdf5(); /* Test detecting HDF5 files correctly */
|
test_file_ishdf5(); /* Test detecting HDF5 files correctly */
|
||||||
test_file_open_dot(); /* Test opening objects with "." for a name */
|
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 */
|
test_file_open_overlap(); /* Test opening files in an overlapping manner */
|
||||||
|
#endif /*H5_CANNOT_OPEN_TWICE*/
|
||||||
test_file_getname(); /* Test basic H5Fget_name() functionality */
|
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_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_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_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 */
|
test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
|
||||||
|
#endif /*H5_CANNOT_OPEN_TWICE*/
|
||||||
} /* test_file() */
|
} /* test_file() */
|
||||||
|
|
||||||
|
|
||||||
@ -1852,8 +1865,8 @@ test_file(void)
|
|||||||
void
|
void
|
||||||
cleanup_file(void)
|
cleanup_file(void)
|
||||||
{
|
{
|
||||||
remove(FILE1);
|
HDremove(FILE1);
|
||||||
remove(FILE2);
|
HDremove(FILE2);
|
||||||
remove(FILE3);
|
HDremove(FILE3);
|
||||||
remove(FILE4);
|
HDremove(FILE4);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user