summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-03-17 21:50:32 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-03-17 21:50:32 (GMT)
commit4494348eb229ae0661754c974695d8a293c6168b (patch)
treea5e98a61dbfc55ab9556a602ba3288ef33e2a1e4 /test
parent31a709a6b24f4cf80f9cd99a3e55f56e81cf3066 (diff)
downloadhdf5-4494348eb229ae0661754c974695d8a293c6168b.zip
hdf5-4494348eb229ae0661754c974695d8a293c6168b.tar.gz
hdf5-4494348eb229ae0661754c974695d8a293c6168b.tar.bz2
[svn-r323] Changes since 19980316
---------------------- ./src/H5D.c ./src/H5T.c ./src/H5Tprivate.h Fixed a bug found by Kevin Powell regarding preservation of existing data during a read or write when the source and destination data types are the same. Thanks Kevin! Fixed a couple warnings on Irix64. ./src/H5D.c ./src/H5Dprivate.h ./src/H5P.c ./src/H5Ppublic.c ./src/H5Tconv.c ./src/H5Tpublic.h ./test/cmpd_dset.c The application can now turn on/off the part of the I/O pipeline that deals with preservation of initialized data. The default is off since this will be the usual case and turning it on slows down the pipe. Use H5Pset_preserve() and H5Pget_preserve(). ./src/H5Fistore.c Added an optimization for reading/writing a single chunk of chunked storage. ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Osdspace.c ./src/H5Ostab.c Fixed warnings reported by marek@iiasa.ac.at. Thanks Marek. ./src/H5Odtype.c Fixed a failing assert() wrt reading compound types (not present in hdf5-1.0.0a).
Diffstat (limited to 'test')
-rw-r--r--test/cmpd_dset.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index a98a9b3..cd36ca1 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -5,6 +5,7 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Friday, January 23, 1998
*/
+#undef NDEBUG
#include <assert.h>
#include <hdf5.h>
#include <stdio.h>
@@ -121,7 +122,7 @@ main (void)
/* Other variables */
int i, j, ndims;
- hid_t file, dataset, space;
+ hid_t file, dataset, space, PRESERVE;
herr_t status;
static size_t dim[] = {NX, NY};
int f_offset[2]; /*offset of hyperslab in file */
@@ -137,7 +138,11 @@ main (void)
space = H5Screate_simple (2, dim, NULL);
assert (space>=0);
-
+ /* Create xfer properties to preserve initialized data */
+ PRESERVE = H5Pcreate (H5P_DATASET_XFER);
+ assert (PRESERVE>=0);
+ status = H5Pset_preserve (PRESERVE, 1);
+ assert (status>=0);
/*
*######################################################################
@@ -291,7 +296,7 @@ STEP 5: Read members into a superset which is partially initialized.\n");
assert (s5_tid>=0);
/* Read the data */
- status = H5Dread (dataset, s5_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s5);
+ status = H5Dread (dataset, s5_tid, H5S_ALL, H5S_ALL, PRESERVE, s5);
assert (status>=0);
/* Check that the data was read properly */
@@ -329,7 +334,7 @@ STEP 6: Update fields `b' and `d' on the file, leaving the other fields\n\
}
/* Write the data to file */
- status = H5Dwrite (dataset, s4_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s4);
+ status = H5Dwrite (dataset, s4_tid, H5S_ALL, H5S_ALL, PRESERVE, s4);
assert (status>=0);
/* Read the data back */
@@ -474,7 +479,7 @@ STEP 10: Read middle third of hyperslab into middle third of memory array\n\
memset (s5, 0xFF, NX*NY*sizeof(s5_t));
/* Read the hyperslab */
- status = H5Dread (dataset, s5_tid, s8_f_sid, s8_f_sid, H5P_DEFAULT, s5);
+ status = H5Dread (dataset, s5_tid, s8_f_sid, s8_f_sid, PRESERVE, s5);
assert (status>=0);
/* Compare */
@@ -525,7 +530,7 @@ STEP 11: Write an array back to the middle third of the dataset to\n\
memset (s11, 0xff, h_size[0]*h_size[1]*sizeof(s4_t));
/* Write to disk */
- status = H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s11);
+ status = H5Dwrite (dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11);
assert (status>=0);
/* Read the whole thing */