summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2009-03-25 15:29:55 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2009-03-25 15:29:55 (GMT)
commit4a344e35a6ffa96dc1329f3ba9cb77573e9853c5 (patch)
treeaf9e48d7b27e4aa219814c3a9b923f8c3f172bf5
parenta258b92904ff743e17837425019bbfd7a64c6f6d (diff)
downloadhdf5-4a344e35a6ffa96dc1329f3ba9cb77573e9853c5.zip
hdf5-4a344e35a6ffa96dc1329f3ba9cb77573e9853c5.tar.gz
hdf5-4a344e35a6ffa96dc1329f3ba9cb77573e9853c5.tar.bz2
[svn-r16610] Modified the test of family driver for forward compatibility. Open the file twice to make
sure the superblock isn't corrupted. Tested on jam - simple test.
-rw-r--r--test/file_handle.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/file_handle.c b/test/file_handle.c
index 4a4783a..27c1dd5 100644
--- a/test/file_handle.c
+++ b/test/file_handle.c
@@ -362,6 +362,8 @@ static herr_t
test_family_compat(void)
{
hid_t file=(-1), fapl;
+ hid_t dset;
+ char dname[]="dataset";
char filename[1024];
char pathname[1024];
char *srcdir = getenv("srcdir"); /*where the src code is located*/
@@ -384,12 +386,32 @@ test_family_compat(void)
}
strcat(pathname, filename);
+ /* Make sure we can open the file. Use the read and write mode. */
if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0)
goto error;
+ if((dset = H5Dopen(file, dname)) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(dset) < 0)
+ TEST_ERROR;
+
if(H5Fclose(file)<0)
goto error;
+ /* Open the file again to make sure it isn't corrupted. */
+ if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR;
+
+ if((dset = H5Dopen(file, dname)) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(dset) < 0)
+ TEST_ERROR;
+
+ if(H5Fclose(file) < 0)
+ TEST_ERROR;
+
h5_cleanup(FILENAME, fapl);
PASSED();
return 0;