summaryrefslogtreecommitdiffstats
path: root/test/set_extent.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-03-24 16:41:14 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-03-24 16:41:14 (GMT)
commitd3d4d8782bbed2af7d1593759e3665c459c0ab1c (patch)
treef3f3f449f62cc3ea2462112bbd38a5b1057c1d67 /test/set_extent.c
parent2ee007117626d307a248b6b02f5ddb71766cb35f (diff)
downloadhdf5-d3d4d8782bbed2af7d1593759e3665c459c0ab1c.zip
hdf5-d3d4d8782bbed2af7d1593759e3665c459c0ab1c.tar.gz
hdf5-d3d4d8782bbed2af7d1593759e3665c459c0ab1c.tar.bz2
[svn-r18445] Purpose: Fix bug 1637
Description: Modified algorithm for extending a dataset with early allocation so it only deals with the new chunks. Formerly, it would loop over all chunks, checking to see if each existed in cache and on disk, causing major performance issues with large numbers of chunks. Tested: jam, linew, amani (h5committest)
Diffstat (limited to 'test/set_extent.c')
-rw-r--r--test/set_extent.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/set_extent.c b/test/set_extent.c
index b35af8e..9d669a2 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -1353,6 +1353,54 @@ static int test_rank2( hid_t fapl,
/*-------------------------------------------------------------------------
+ * expand then shrink to 0 in dimension 1 while expanding again in
+ * dimension 0
+ *
+ *-------------------------------------------------------------------------
+ */
+
+
+ /* expand to original dimensions for the array. */
+ if (H5Dset_extent(did , dims_o) < 0)
+ {
+ TEST_ERROR
+ }
+
+ dims_s[0] = dims_e[0];
+ dims_s[1] = 0;
+
+ /* set new dimensions for the array. */
+ if (H5Dset_extent(did , dims_s) < 0)
+ {
+ TEST_ERROR
+ }
+
+ /* get the space */
+ if ((sid = H5Dget_space(did)) < 0)
+ {
+ TEST_ERROR
+ }
+
+ /* get dimensions */
+ if (H5Sget_simple_extent_dims(sid, dims_r, NULL) < 0)
+ {
+ TEST_ERROR
+ }
+
+ if (H5Sclose(sid) < 0)
+ {
+ TEST_ERROR
+ }
+
+ /* check dimensions */
+ for( i = 0; i < RANK2; i++ )
+ {
+ if (dims_r[i] != dims_s[i])
+ TEST_ERROR
+ }
+
+
+ /*-------------------------------------------------------------------------
* close dataset
*-------------------------------------------------------------------------
*/