diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-10-21 13:08:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-10-21 13:08:44 (GMT) |
commit | ba665404620b16f0e5140c5f1d19b18ffb68590e (patch) | |
tree | 8759a98880bc6b7fc7cc1b1612f6548207837cef /test | |
parent | 9e2fff4540bbbc1718e1395f101973800f706eb9 (diff) | |
download | hdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.zip hdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.tar.gz hdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.tar.bz2 |
[svn-r19654] Description:
Bring Coverity revisions from branch back to trunk, and clean up some other
misc. compiler warnings also.
r19500:
Fix coverity items 1446 and 1447. Moved up calls to memset in test_cont in
ohdr.c so the test never tries to close uninitialized locations.
r19501:
Fix coverity items 1398-1445. Various uninitialized variable errors in fheap.c.
r19502:
Fixed coverity issue 579 and some additional warnings in the file as well.
r19503:
Bug fix: This fix addressed the "RESOURCE_LEAK" problems #789 and 790, run 26
r19504:
minor mods to try to keep coverity from flagging false positives.
r19505:
Fixed coverity issues 566 - 571. Declared variables that are passed to functions that use them as arrays to be arrays of size 1.
Tested on:
Mac OS X/32 10.6.4 (amazon) w/debug, production & parallel
(h5committested on trunk)
Diffstat (limited to 'test')
-rw-r--r-- | test/fheap.c | 376 | ||||
-rw-r--r-- | test/ohdr.c | 6 |
2 files changed, 191 insertions, 191 deletions
diff --git a/test/fheap.c b/test/fheap.c index e38302c..3d8e69d 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -7621,14 +7621,14 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from root direct block of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill the heap up */ state.man_size = DBLOCK_SIZE(fh, 0); @@ -7695,14 +7695,14 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from two direct blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill the first block in heap */ state.man_size = DBLOCK_SIZE(fh, 0); @@ -7784,14 +7784,14 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill first row of direct blocks */ if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) @@ -7855,14 +7855,14 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill first two rows of direct blocks */ if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) @@ -7928,14 +7928,14 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill first two rows of direct blocks */ if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) @@ -8005,14 +8005,14 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -8076,14 +8076,14 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -8151,14 +8151,14 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -8235,14 +8235,14 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "inserting object that is too large for starting block, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_size += cparam->managed.width * DBLOCK_SIZE(fh, 1); @@ -8313,14 +8313,14 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "skipping starting block, then adding object back to first block, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Insert object too large for starting block size */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; @@ -8413,14 +8413,14 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Insert object too large for starting block size */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; @@ -8522,14 +8522,14 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Insert small object, to create root direct block */ state.man_size = DBLOCK_SIZE(fh, 0); @@ -8621,14 +8621,14 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Insert small object, to create root direct block */ state.man_size = DBLOCK_SIZE(fh, 0); @@ -8766,14 +8766,14 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill initial direct block */ state.man_size = DBLOCK_SIZE(fh, 0); @@ -8931,14 +8931,14 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill first row of direct blocks */ if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) @@ -9060,14 +9060,14 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Compute # direct block rows in root indirect block */ num_direct_rows = DTABLE_MAX_DROWS(fh); @@ -9185,14 +9185,14 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -9312,14 +9312,14 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -9440,14 +9440,14 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -9587,14 +9587,14 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -9757,14 +9757,14 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -9911,14 +9911,14 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -10088,14 +10088,14 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -10217,14 +10217,14 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) @@ -10357,14 +10357,14 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -10509,14 +10509,14 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -10672,14 +10672,14 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -10835,14 +10835,14 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11002,14 +11002,14 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11164,14 +11164,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11344,14 +11344,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11559,14 +11559,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11756,14 +11756,14 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -11982,14 +11982,14 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Insert objects small enough to fit into initial blocks, but not to * share them with other objects of the same size, until the next larger @@ -12115,14 +12115,14 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Retrieve # of direct rows in root indirect block */ root_direct_rows = H5HF_get_dtable_max_drows_test(fh); @@ -12288,14 +12288,14 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Compute # of bits used in first row */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); @@ -12402,14 +12402,14 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * const char *base_desc = "fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Compute # of direct rows in root indirect block */ root_direct_rows = DTABLE_MAX_DROWS(fh); @@ -12519,14 +12519,14 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert one huge object, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -12673,14 +12673,14 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert two huge objects, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -12907,14 +12907,14 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert three huge objects, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -13217,14 +13217,14 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -13855,14 +13855,14 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert one tiny object, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -14009,14 +14009,14 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert two tiny objects, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -14248,14 +14248,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar fheap_heap_state_t state; /* State of fractal heap */ const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; /* Test description */ - /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) - TEST_ERROR - /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) TEST_ERROR + /* Perform common file & heap open operations */ + if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + TEST_ERROR + /* Allocate heap ID(s) */ if(NULL == (heap_id = (unsigned char *)H5MM_malloc(tparam->actual_id_len))) TEST_ERROR @@ -15365,6 +15365,9 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa fheap_heap_state_t state; /* State of fractal heap */ size_t u; /* Local index variable */ + /* Initialize the heap ID structure */ + HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); + /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15404,9 +15407,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TESTING("inserting random-sized objects, then remove all objects (all - random)") } /* end else */ - /* Initialize the heap ID structure */ - HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); - /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); #ifdef QAK @@ -15569,6 +15569,9 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te fheap_heap_state_t state; /* State of fractal heap */ size_t u; /* Local index variable */ + /* Initialize the heap ID structure */ + HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); + /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15608,9 +15611,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te TESTING("inserting random-sized objects with power of 2 distribution, then remove all objects (all - random)") } /* end else */ - /* Initialize the heap ID structure */ - HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); - /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); #ifdef QAK @@ -15805,6 +15805,9 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) else TESTING("writing objects in heap") + /* Initialize the heap ID structure */ + HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); + /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15843,9 +15846,6 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) if(id_len > MAX_HEAP_ID_LEN) TEST_ERROR - /* Initialize the heap ID structure */ - HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); - /* Create 'tiny' and 'huge' objects */ obj_size = id_len / 2; @@ -16072,6 +16072,9 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) */ TESTING("bug1: inserting several objects & removing one, then re-inserting") + /* Initialize the heap ID structure */ + HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); + /* Perform common file & heap open operations */ if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -16082,9 +16085,6 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) if(id_len > MAX_HEAP_ID_LEN) TEST_ERROR - /* Initialize the heap ID structure */ - HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); - /* Insert objects */ obj_size = 44; obj_loc = 1; diff --git a/test/ohdr.c b/test/ohdr.c index 8494d51..109d59c 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -68,6 +68,9 @@ test_cont(char *filename, hid_t fapl) TESTING("object header continuation block"); + HDmemset(&oh_locA, 0, sizeof(oh_locA)); + HDmemset(&oh_locB, 0, sizeof(oh_locB)); + /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR @@ -77,9 +80,6 @@ test_cont(char *filename, hid_t fapl) goto error; } - HDmemset(&oh_locA, 0, sizeof(oh_locA)); - HDmemset(&oh_locB, 0, sizeof(oh_locB)); - if(H5O_create(f, H5P_DATASET_XFER_DEFAULT, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0) FAIL_STACK_ERROR |