summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-10-08 00:17:11 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-10-08 00:17:11 (GMT)
commitbe6691b33d0402dbaef53256382b45ab02d7fba8 (patch)
tree7ea49525f534cf7c3328db8ce82bb55a83074432 /test
parentde76999134dffc8700b88115c4bde5fe75acfc60 (diff)
downloadhdf5-be6691b33d0402dbaef53256382b45ab02d7fba8.zip
hdf5-be6691b33d0402dbaef53256382b45ab02d7fba8.tar.gz
hdf5-be6691b33d0402dbaef53256382b45ab02d7fba8.tar.bz2
[svn-r17610] 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')
-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;
+ }
/*
*######################################################################