summaryrefslogtreecommitdiffstats
path: root/test/cmpd_dset.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-10-08 00:20:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-10-08 00:20:57 (GMT)
commitd612aa916b0da818d288cdf4f7e6b39174b3bd61 (patch)
treee262f519846308f698a7629c23c52de4cae7fde3 /test/cmpd_dset.c
parent8d8f365711cd9c5bb27a7db31d986dad779506f6 (diff)
downloadhdf5-d612aa916b0da818d288cdf4f7e6b39174b3bd61.zip
hdf5-d612aa916b0da818d288cdf4f7e6b39174b3bd61.tar.gz
hdf5-d612aa916b0da818d288cdf4f7e6b39174b3bd61.tar.bz2
[svn-r17611] Bug fix (ID 1628):
There was a typo in the H5Pget_preserve that it was returning the wrong value. Fixed. Also added a test in test/cmpd_dset.c to verify the correctness of H5Pset_preserve and H5Pget_preserve. Tested: h5committest plus jam serial.
Diffstat (limited to 'test/cmpd_dset.c')
-rw-r--r--test/cmpd_dset.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 53c63d7..167e6a1 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -199,6 +199,7 @@ test_compound (char *filename, hid_t fapl)
hsize_t f_offset[2]; /*offset of hyperslab in file */
hsize_t h_size[2]; /*size of hyperslab */
hsize_t memb_size[1] = {4};
+ int ret_code;
/* Create the file */
if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
@@ -209,8 +210,19 @@ test_compound (char *filename, hid_t fapl)
if ((space = H5Screate_simple (2, dim, NULL)) < 0) goto error;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER)) < 0) goto error;
- if (H5Pset_preserve (PRESERVE, 1) < 0) goto error;
+ /* Also verify H5Pset_preserve is initially 0 and then is set to 1. */
+ if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
+ if ((ret_code=H5Pget_preserve (PRESERVE)) != 0){
+ printf("Preserve status of dataset transfer property list should be"
+ " 0 (FALSE), got %d\n", ret_code);
+ goto error;
+ }
+ if (H5Pset_preserve (PRESERVE, 1)<0) goto error;
+ if ((ret_code=H5Pget_preserve (PRESERVE)) != 1){
+ printf("Preserve status of dataset transfer property list should be"
+ " 1 (TRUE), got %d\n", ret_code);
+ goto error;
+ }
/*
*######################################################################