diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-01-26 20:56:18 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-01-26 20:56:18 (GMT) |
commit | 5c6a3af39679b2bbbdaebf8f1c19edbeed7af248 (patch) | |
tree | 8c495a15af0ae785dfcb22420e197d583deef7ba /test/cmpd_dset.c | |
parent | 6cd8818b735d3c22f3a1f7cd30d52360139ed72c (diff) | |
download | hdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.zip hdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.tar.gz hdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.tar.bz2 |
[svn-r170] Changes since 19980123
----------------------
./src/H5D.c
./src/H5T.c
./src/H5Tconv.c
./src/H5Tpkg.h
./src/H5Tprivate.h
./src/H5Tpublic.h
./test/cmpd_dset.c
Added support to turn background buffer on/off to help speed
up conversions. Currently, every type of conversion turns it
off except compound-->compound conversions which always turn
it on. In the future the compound-->compound conversions
might be more frugal.
Diffstat (limited to 'test/cmpd_dset.c')
-rw-r--r-- | test/cmpd_dset.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 3676890..b0586f6 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -50,8 +50,8 @@ typedef struct s5_t { } s5_t; -#define NX 10 -#define NY 200 +#define NX 100 +#define NY 2000 static hid_t @@ -278,6 +278,7 @@ STEP 5: Read members into a superset which is partially initialized.\n"); /* Read the data */ status = H5Dread (dataset, s5_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s5); + assert (status>=0); /* Check that the data was read properly */ for (i=0; i<NX*NY; i++) { @@ -295,6 +296,46 @@ STEP 5: Read members into a superset which is partially initialized.\n"); assert (s5[i].mid2 == 1002+4*i); assert (s5[i].post == 1003+4*i); } + + /* + *###################################################################### + * STEP 6: Update fields `b' and `d' on the file leaving the other + * fields unchanged. This tests member alignment and background + * buffers. + */ + printf ("\ +STEP 6: Update fields `b' and `d' on the file, leaving the other fields\n\ + unchanged.\n"); + fflush (stdout); + + /* Initialize `s4' with new values */ + for (i=0; i<NX*NY; i++) { + s4[i].b = 2000+2*i; + s4[i].d = 2001+2*i; + } + + /* Write the data to file */ + status = H5Dwrite (dataset, s4_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s4); + assert (status>=0); + + /* Read the data back */ + status = H5Dread (dataset, s2_tid, H5P_ALL, H5P_ALL, H5C_DEFAULT, s2); + assert (status>=0); + + /* Compare */ + for (i=0; i<NX*NY; i++) { + assert (s2[i].a == s1[i].a); + assert (s2[i].b == s4[i].b); + assert (s2[i].c == s1[i].c); + assert (s2[i].d == s4[i].d); + assert (s2[i].e == s1[i].e); + } + + + + + + /* |