summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2009-03-24 22:06:07 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2009-03-24 22:06:07 (GMT)
commitffd0fddad2117675ffb80a4bb0da4c0e5d0a3112 (patch)
tree05e675f4e0c188697e8500f9c4226ffac9e556a4 /test/vfd.c
parentfdedcd9ceb2b9d58ad0cf1ef29a593e824fca81e (diff)
downloadhdf5-ffd0fddad2117675ffb80a4bb0da4c0e5d0a3112.zip
hdf5-ffd0fddad2117675ffb80a4bb0da4c0e5d0a3112.tar.gz
hdf5-ffd0fddad2117675ffb80a4bb0da4c0e5d0a3112.tar.bz2
[svn-r16609] Bug fix (#1161): When a family file created with v1.6 library is opened and closed with
v1.8 library, v1.8 library writes the driver info block in the superblock. But v1.6 doesn't write it. This caused the data after the superblock to be overwritten. The solution is to use a flag to indicate when the original file doesn't have the driver info, v1.8 library doesn't write it either. Tested on jam. I have some trouble to access smirom and linew using h5committest.
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/vfd.c b/test/vfd.c
index 310b931..3e792cc 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -802,6 +802,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*/
@@ -824,7 +826,28 @@ test_family_compat(void)
}
HDstrcat(pathname, filename);
- if((file = H5Fopen(pathname, H5F_ACC_RDONLY, fapl)) < 0)
+ /* Make sure we can open the file. Use the read and write mode to flush the
+ * superblock. */
+ if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR;
+
+ if((dset = H5Dopen(file, dname, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(dset) < 0)
+ TEST_ERROR;
+
+ if(H5Fclose(file) < 0)
+ TEST_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, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(dset) < 0)
TEST_ERROR;
if(H5Fclose(file) < 0)