summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2012-06-06 21:12:34 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2012-06-06 21:12:34 (GMT)
commit596d5b2662e0cd9003efdfce6dd0fa160395ba67 (patch)
tree89e20ff22e826fa7b2a486c72b7a85c61deb7f69 /test
parent71ca559f81df96e2e792e4bb831f4f07db860cf9 (diff)
downloadhdf5-596d5b2662e0cd9003efdfce6dd0fa160395ba67.zip
hdf5-596d5b2662e0cd9003efdfce6dd0fa160395ba67.tar.gz
hdf5-596d5b2662e0cd9003efdfce6dd0fa160395ba67.tar.bz2
[svn-r22438] (1) fix for making MEM_GHEAP as MEM_DRAW
(2) fix to extend into the aggregator based on threshold (3) fix for the "flavor" logging problem (4) fix for test failures due to the above fixes (5) bug fix for h5stat when h5stat against a non-existing file --Ths line, and th se below, will be ignored-- M test/mf.c M src/H5MFaggr.c M src/H5FDpublic.h M src/H5MF.c M src/H5FDmulti.c M src/H5FDlog.c M src/H5Faccum.c M tools/h5copy/testfiles/h5copytst.out.ls M tools/h5copy/testfiles/h5copy_ref.out.ls M tools/h5stat/testh5stat.sh.in M tools/h5stat/h5stat.c
Diffstat (limited to 'test')
-rw-r--r--test/mf.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/test/mf.c b/test/mf.c
index 005e5a0..e3c3082 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -3165,8 +3165,13 @@ error:
* To verify that a block can be extended from the aggregator
*
* Test 1: Allocate block A from meta_aggr which is at end of file
- * Try to extend a block which adjoins the aggregator
- * H5MF_try_extend() succeeds: meta_aggr is extended by extended-request and meta_aggr's info is updated
+ * Try to extend the block which adjoins the aggregator that is at end of file
+ * a. block size < (% * aggr->alloc_size)
+ * The block is allocated from the aggregator
+ * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size
+ * The block is extended by aggr->alloc_size and the block is allocated from the aggregator
+ * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size
+ * The block is extended by extended-request and the block is allocated from the aggregator
*
* Test 2: Allocate block A from meta_aggr
* Allocate block B from sdata_aggr so that meta_aggr is not at end of file
@@ -3233,7 +3238,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
- /* Try to extend the block */
+ /* Try to extend the block by an amount < (% * aggr->alloc_size) */
extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
/* should succeed */
@@ -3244,15 +3249,42 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if (new_ma_addr != (addr+TEST_BLOCK_SIZE50))
TEST_ERROR
- if (new_ma_size != f->shared->meta_aggr.alloc_size) TEST_ERROR
+ if (new_ma_size != (f->shared->meta_aggr.alloc_size - TEST_BLOCK_SIZE50)) TEST_ERROR
- /* Restore info for meta_aggr */
- f->shared->meta_aggr.addr = ma_addr;
- f->shared->meta_aggr.size = ma_size;
+ /* Free the allocated blocks */
+ H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE50);
+
+ /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */
+ extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE700));
+
+ /* should succeed */
+ if(!extended)
+ TEST_ERROR
+
+ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+
+ if (new_ma_addr != (addr + TEST_BLOCK_SIZE700))
+ TEST_ERROR
+ if (new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TEST_BLOCK_SIZE700)) TEST_ERROR
/* Free the allocated blocks */
- H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30);
- H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, (ma_addr+ma_size), (hsize_t)TEST_BLOCK_SIZE50);
+ H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE700);
+
+ /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */
+ extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE2058));
+
+ /* should succeed */
+ if(!extended)
+ TEST_ERROR
+
+ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+
+ if (new_ma_addr != (addr + TEST_BLOCK_SIZE2058))
+ TEST_ERROR
+ if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR
+
+ /* Free the allocated blocks */
+ H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE2058);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR