diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-09 03:52:46 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-09 03:52:46 (GMT) |
commit | 261bbe39aac2cf13e2cd539520c3329e1df6d452 (patch) | |
tree | 0fcbcd9c19ae366fe6ac7e0216f5f753fd46117e /test | |
parent | 37aaef8fe09017234e163bc78f617d0676ca2072 (diff) | |
download | hdf5-261bbe39aac2cf13e2cd539520c3329e1df6d452.zip hdf5-261bbe39aac2cf13e2cd539520c3329e1df6d452.tar.gz hdf5-261bbe39aac2cf13e2cd539520c3329e1df6d452.tar.bz2 |
[svn-r15826] Description:
Bring revision 15825 from trunk:
Fix various problems with a the core & sec2 VFDs.
Improve the h5_get_file_size() routine to handle files created with
VFDs that use multiple files.
Tested on:
FreeBSD/32 6.3 (duty)
Already tested on other machine, in trunk.
Diffstat (limited to 'test')
-rw-r--r-- | test/btree2.c | 194 | ||||
-rw-r--r-- | test/dangle.c | 30 | ||||
-rw-r--r-- | test/fheap.c | 179 | ||||
-rw-r--r-- | test/freespace.c | 198 | ||||
-rw-r--r-- | test/h5test.c | 100 | ||||
-rw-r--r-- | test/h5test.h | 2 | ||||
-rw-r--r-- | test/links.c | 51 | ||||
-rw-r--r-- | test/mf.c | 307 | ||||
-rw-r--r-- | test/stab.c | 35 | ||||
-rw-r--r-- | test/tattr.c | 52 | ||||
-rw-r--r-- | test/tfile.c | 4 | ||||
-rw-r--r-- | test/tsohm.c | 44 | ||||
-rw-r--r-- | test/unlink.c | 58 |
13 files changed, 677 insertions, 577 deletions
diff --git a/test/btree2.c b/test/btree2.c index a25a373..84d90f6 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -219,7 +219,7 @@ remove_cb(const void *_record, void *_op_data) * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_basic(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -238,7 +238,7 @@ test_insert_basic(hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -404,7 +404,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_split_root(hid_t fapl) { hid_t file=-1; @@ -425,7 +425,7 @@ test_insert_split_root(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -580,7 +580,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level1_2leaf_redistrib(hid_t fapl) { hid_t file=-1; @@ -599,7 +599,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -740,7 +740,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level1_side_split(hid_t fapl) { hid_t file=-1; @@ -759,7 +759,7 @@ test_insert_level1_side_split(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -911,7 +911,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level1_3leaf_redistrib(hid_t fapl) { hid_t file=-1; @@ -931,7 +931,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -1059,7 +1059,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level1_middle_split(hid_t fapl) { hid_t file=-1; @@ -1079,7 +1079,7 @@ test_insert_level1_middle_split(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -1183,7 +1183,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_make_level2(hid_t fapl) { hid_t file=-1; @@ -1204,7 +1204,7 @@ test_insert_make_level2(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -1367,7 +1367,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_leaf_redistrib(hid_t fapl) { hid_t file=-1; @@ -1387,7 +1387,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -1632,7 +1632,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_leaf_split(hid_t fapl) { hid_t file=-1; @@ -1652,7 +1652,7 @@ test_insert_level2_leaf_split(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -1908,7 +1908,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_2internal_redistrib(hid_t fapl) { hid_t file=-1; @@ -1928,7 +1928,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -2101,7 +2101,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_2internal_split(hid_t fapl) { hid_t file=-1; @@ -2121,7 +2121,7 @@ test_insert_level2_2internal_split(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -2304,7 +2304,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_3internal_redistrib(hid_t fapl) { hid_t file=-1; @@ -2324,7 +2324,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -2506,7 +2506,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_level2_3internal_split(hid_t fapl) { hid_t file=-1; @@ -2526,7 +2526,7 @@ test_insert_level2_3internal_split(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -2711,7 +2711,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_insert_lots(hid_t fapl) { hid_t file=-1; @@ -2743,7 +2743,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TESTING("B-tree insert: create random level 4 B-tree"); /* Allocate space for the records */ - if((records = HDmalloc(sizeof(hsize_t) * INSERT_MANY)) == NULL) + if((records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY)) == NULL) TEST_ERROR /* Initialize record #'s */ @@ -2752,7 +2752,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Shuffle record #'s */ for(u=0; u<INSERT_MANY; u++) { - swap_idx = (unsigned)(HDrandom()%(INSERT_MANY-u))+u; + swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u; temp_rec = records[u]; records[u] = records[swap_idx]; records[swap_idx] = temp_rec; @@ -2765,7 +2765,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* @@ -2798,7 +2798,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Check up on B-tree after re-open */ @@ -2917,7 +2917,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_basic(hid_t fapl) { hid_t file=-1; @@ -2937,7 +2937,7 @@ test_remove_basic(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* Record removal tests */ @@ -3202,7 +3202,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_noredistrib(hid_t fapl) { hid_t file=-1; @@ -3224,7 +3224,7 @@ test_remove_level1_noredistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* B-tree record removal tests */ @@ -3425,7 +3425,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_redistrib(hid_t fapl) { hid_t file=-1; @@ -3446,7 +3446,7 @@ test_remove_level1_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* More complex record removals */ @@ -3625,7 +3625,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_2leaf_merge(hid_t fapl) { hid_t file=-1; @@ -3647,7 +3647,7 @@ test_remove_level1_2leaf_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (r->l)"); @@ -3809,7 +3809,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_3leaf_merge(hid_t fapl) { hid_t file=-1; @@ -3831,7 +3831,7 @@ test_remove_level1_3leaf_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: merge 3 leaves to 2 in level-1 B-tree"); @@ -3937,7 +3937,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_promote(hid_t fapl) { hid_t file=-1; @@ -3959,7 +3959,7 @@ test_remove_level1_promote(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from right leaf of level-1 B-tree"); @@ -4181,7 +4181,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_promote_2leaf_redistrib(hid_t fapl) { hid_t file=-1; @@ -4203,7 +4203,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2 node redistrib"); @@ -4334,7 +4334,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_promote_3leaf_redistrib(hid_t fapl) { hid_t file=-1; @@ -4356,7 +4356,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3 node redistrib"); @@ -4487,7 +4487,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_promote_2leaf_merge(hid_t fapl) { hid_t file=-1; @@ -4509,7 +4509,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2->1 merge"); @@ -4635,7 +4635,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_promote_3leaf_merge(hid_t fapl) { hid_t file=-1; @@ -4657,7 +4657,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3->2 merge"); @@ -4783,7 +4783,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level1_collapse(hid_t fapl) { hid_t file=-1; @@ -4804,7 +4804,7 @@ test_remove_level1_collapse(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: collapse level-1 B-tree back to level-0"); @@ -4922,7 +4922,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_promote(hid_t fapl) { hid_t file=-1; @@ -4944,7 +4944,7 @@ test_remove_level2_promote(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from right internal of level-2 B-tree"); @@ -5213,7 +5213,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_promote_2internal_redistrib(hid_t fapl) { hid_t file=-1; @@ -5235,7 +5235,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib"); @@ -5366,7 +5366,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_promote_3internal_redistrib(hid_t fapl) { hid_t file=-1; @@ -5388,7 +5388,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from left internal of level-2 B-tree w/redistrib"); @@ -5519,7 +5519,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_promote_2internal_merge(hid_t fapl) { hid_t file=-1; @@ -5541,7 +5541,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from right internal of level-2 B-tree w/merge"); @@ -5675,7 +5675,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_promote_3internal_merge(hid_t fapl) { hid_t file=-1; @@ -5697,7 +5697,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: promote from middle internal of level-2 B-tree w/merge"); @@ -5831,7 +5831,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_2internal_merge_left(hid_t fapl) { hid_t file=-1; @@ -5853,7 +5853,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (l->r)"); @@ -5959,7 +5959,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_2internal_merge_right(hid_t fapl) { hid_t file=-1; @@ -5981,7 +5981,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (r->l)"); @@ -6087,7 +6087,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_3internal_merge(hid_t fapl) { hid_t file=-1; @@ -6109,7 +6109,7 @@ test_remove_level2_3internal_merge(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: merge 3 internal nodes to 2 in level-2 B-tree"); @@ -6215,7 +6215,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_level2_collapse_right(hid_t fapl) { hid_t file=-1; @@ -6238,7 +6238,7 @@ test_remove_level2_collapse_right(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR TESTING("B-tree remove: collapse level-2 B-tree back to level-1 (r->l)"); @@ -6343,7 +6343,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_remove_lots(hid_t fapl) { hid_t file = -1; @@ -6376,7 +6376,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); */ /* Allocate space for the records */ - if(NULL == (records = HDmalloc(sizeof(hsize_t) * INSERT_MANY))) + if(NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY))) TEST_ERROR /* Initialize record #'s */ @@ -6388,7 +6388,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); hsize_t temp_rec; /* Temporary record */ unsigned swap_idx; /* Location to swap with when shuffling */ - swap_idx = (unsigned)(HDrandom() % (INSERT_MANY - u)) + u; + swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u; temp_rec = records[u]; records[u] = records[swap_idx]; records[swap_idx] = temp_rec; @@ -6401,7 +6401,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -6461,7 +6461,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Re-shuffle record #'s */ @@ -6469,7 +6469,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); hsize_t temp_rec; /* Temporary record */ unsigned swap_idx; /* Location to swap with when shuffling */ - swap_idx = (unsigned)(HDrandom() % (INSERT_MANY - u)) + u; + swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u; temp_rec = records[u]; records[u] = records[swap_idx]; records[swap_idx] = temp_rec; @@ -6536,13 +6536,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { /* Pick a record index to remove from randomly */ - rem_idx = (unsigned)(HDrandom() % (INSERT_MANY - u)); + rem_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)); rrecord = HSIZET_MAX; /* Remove random record */ @@ -6603,7 +6603,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Remove all records */ @@ -6667,7 +6667,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Remove all records */ @@ -6738,7 +6738,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_find_neighbor(hid_t fapl) { hid_t file=-1; @@ -6753,7 +6753,7 @@ test_find_neighbor(hid_t fapl) herr_t ret; /* Generic error return value */ /* Allocate space for the records */ - if((records = HDmalloc(sizeof(hsize_t)*FIND_NEIGHBOR))==NULL) + if((records = (hsize_t *)HDmalloc(sizeof(hsize_t)*FIND_NEIGHBOR))==NULL) TEST_ERROR /* Initialize record #'s */ @@ -6772,7 +6772,7 @@ test_find_neighbor(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -6959,7 +6959,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_delete(hid_t fapl) { hid_t file=-1; @@ -6988,7 +6988,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get the size of an empty file */ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Create the file to work on */ @@ -6996,7 +6996,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -7016,7 +7016,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -7033,7 +7033,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -7066,7 +7066,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -7083,7 +7083,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -7116,7 +7116,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -7133,7 +7133,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -7166,7 +7166,7 @@ test_delete(hid_t fapl) STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -7200,7 +7200,7 @@ error: * *------------------------------------------------------------------------- */ -static int +static unsigned test_modify(hid_t fapl) { hid_t file=-1; @@ -7227,7 +7227,7 @@ test_modify(hid_t fapl) STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) STACK_ERROR /* @@ -7432,7 +7432,7 @@ main(void) envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; - if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { + if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { /* Reset library */ h5_reset(); fapl = h5_fileaccess(); diff --git a/test/dangle.c b/test/dangle.c index b08a5e6..2f8a67e 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -111,13 +111,13 @@ test_dangle_dataset(H5F_close_degree_t degree) if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(h5_get_file_size(filename, fapl) < 0) TEST_ERROR; - if(H5close() < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(h5_get_file_size(filename) < 0) + if(H5close() < 0) TEST_ERROR; /* Clean up temporary file */ @@ -202,13 +202,13 @@ test_dangle_group(H5F_close_degree_t degree) if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(h5_get_file_size(filename, fapl) < 0) TEST_ERROR; - if(H5close() < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(h5_get_file_size(filename) < 0) + if(H5close() < 0) TEST_ERROR; /* Clean up temporary file */ @@ -298,13 +298,13 @@ test_dangle_datatype1(H5F_close_degree_t degree) if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(h5_get_file_size(filename, fapl) < 0) TEST_ERROR; - if(H5close() < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(h5_get_file_size(filename) < 0) + if(H5close() < 0) TEST_ERROR; /* Clean up temporary file */ @@ -385,13 +385,13 @@ test_dangle_datatype2(H5F_close_degree_t degree) if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(h5_get_file_size(filename, fapl) < 0) TEST_ERROR; - if(H5close() < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(h5_get_file_size(filename) < 0) + if(H5close() < 0) TEST_ERROR; /* Clean up temporary file */ @@ -492,13 +492,13 @@ test_dangle_attribute(H5F_close_degree_t degree) if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl) < 0) + if(h5_get_file_size(filename, fapl) < 0) TEST_ERROR; - if(H5close() < 0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(h5_get_file_size(filename) < 0) + if(H5close() < 0) TEST_ERROR; /* Clean up temporary file */ diff --git a/test/fheap.c b/test/fheap.c index 1dd39bc..b71f93c 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -663,7 +663,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((*empty_size = h5_get_file_size(filename)) < 0) + if((*empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -748,7 +748,6 @@ error: * Purpose: Perform common "close" operations on file & heap for testing * * Return: Success: 0 - * * Failure: 1 * * Programmer: Quincey Koziol @@ -757,7 +756,7 @@ error: *------------------------------------------------------------------------- */ static int -close_heap(char *filename, hid_t dxpl, fheap_test_param_t *tparam, +close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, hid_t file, H5F_t *f, H5HF_t **fh, haddr_t fh_addr, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids, h5_stat_size_t empty_size) @@ -796,7 +795,7 @@ close_heap(char *filename, hid_t dxpl, fheap_test_param_t *tparam, FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -1831,7 +1830,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -1883,7 +1882,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -1928,6 +1927,8 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam H5HF_create_t test_cparam; /* Creation parameters for heap */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ + h5_stat_size_t empty_size; /* File size, w/o heap */ + h5_stat_size_t file_size; /* File size, after deleting heap */ size_t id_len; /* Size of fractal heap IDs */ fheap_heap_state_t state; /* State of fractal heap */ @@ -1938,6 +1939,18 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + /* Close file */ + if(H5Fclose(file) < 0) + FAIL_STACK_ERROR + + /* Get the size of a file w/empty heap*/ + if((empty_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Re-open the file */ + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) + FAIL_STACK_ERROR + /* Get a pointer to the internal file object */ if(NULL == (f = H5I_object(file))) STACK_ERROR @@ -1987,6 +2000,14 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is correct size */ + if(file_size != empty_size) + TEST_ERROR + /* All tests passed */ PASSED() @@ -2027,6 +2048,8 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp H5HF_t *fh = NULL; /* Fractal heap wrapper */ H5HF_t *fh2 = NULL; /* 2nd fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ + h5_stat_size_t empty_size; /* File size, w/o heap */ + h5_stat_size_t file_size; /* File size, after deleting heap */ size_t id_len; /* Size of fractal heap IDs */ fheap_heap_state_t state; /* State of fractal heap */ @@ -2041,6 +2064,10 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp if(NULL == (f = H5I_object(file))) STACK_ERROR + /* Get the size of a file w/empty heap*/ + if((empty_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + /* Re-open the file */ if((file2 = H5Freopen(file)) < 0) FAIL_STACK_ERROR @@ -2118,6 +2145,14 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp if(H5Fclose(file2) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is correct size */ + if(file_size != empty_size) + TEST_ERROR + /* All tests passed */ PASSED() @@ -2176,7 +2211,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get the size of a file w/no heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2261,7 +2296,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -6187,7 +6222,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -6252,7 +6287,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -6343,7 +6378,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -6436,7 +6471,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -6528,7 +6563,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -6596,7 +6631,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -6689,7 +6724,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -6827,7 +6862,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -6925,7 +6960,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -7122,7 +7157,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ @@ -7198,7 +7233,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7287,7 +7322,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7358,7 +7393,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7431,7 +7466,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7508,7 +7543,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7579,7 +7614,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7654,7 +7689,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7733,7 +7768,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7815,7 +7850,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7913,7 +7948,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8023,7 +8058,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8117,7 +8152,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8260,7 +8295,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8427,7 +8462,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8557,7 +8592,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8685,7 +8720,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8808,7 +8843,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8936,7 +8971,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9079,7 +9114,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9254,7 +9289,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9406,7 +9441,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9587,7 +9622,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9714,7 +9749,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9853,7 +9888,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10004,7 +10039,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10166,7 +10201,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10328,7 +10363,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10497,7 +10532,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10657,7 +10692,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10835,7 +10870,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11048,7 +11083,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11245,7 +11280,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11478,7 +11513,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11613,7 +11648,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11783,7 +11818,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11896,7 +11931,7 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12015,7 +12050,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Perform common file & heap close operations */ - if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12161,7 +12196,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -12392,7 +12427,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -12698,7 +12733,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -13122,7 +13157,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -13339,7 +13374,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); @@ -13493,7 +13528,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -13724,7 +13759,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -14325,7 +14360,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -14515,9 +14550,10 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para if(H5Fclose(file) < 0) FAIL_STACK_ERROR +/* Needs file free space to be persistent */ #ifdef NOT_YET /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); @@ -14823,9 +14859,10 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa if(H5Fclose(file) < 0) FAIL_STACK_ERROR +/* Needs file free space to be persistent */ #ifdef NOT_YET /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); @@ -14948,7 +14985,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); total_obj_added = 0; while(total_obj_added < size_limit) { /* Choose a random size of object (from 1 up to above standalone block size limit) */ - obj_size = (HDrandom() % (tmp_cparam.max_man_size + 255)) + 1; + obj_size = (((uint32_t)HDrandom() % (tmp_cparam.max_man_size + 255)) + 1); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ @@ -14972,7 +15009,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Choose a position to swap with */ /* (0 is current position) */ - pos = HDrandom() % (keep_ids.num_ids - u); + pos = ((size_t)HDrandom() % (keep_ids.num_ids - u)); /* If we chose a different position, swap with it */ if(pos > 0) { @@ -15021,7 +15058,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); @@ -15164,7 +15201,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); size_range = tmp_cparam.max_man_size + 255; /* Choose a random size of object (from 1 up to stand alone block size) */ - obj_size = (HDrandom() % (size_range - 1)) + 1; + obj_size = (((unsigned)HDrandom() % (size_range - 1)) + 1); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ @@ -15188,7 +15225,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Choose a position to swap with */ /* (0 is current position) */ - pos = HDrandom() % (keep_ids.num_ids - u); + pos = ((size_t)HDrandom() % (keep_ids.num_ids - u)); /* If we chose a different position, swap with it */ if(pos > 0) { @@ -15237,7 +15274,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR #ifdef QAK HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); diff --git a/test/freespace.c b/test/freespace.c index c786ebb..5b24fee 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -25,7 +25,6 @@ /* Other private headers that this test requires */ #define H5F_PACKAGE #include "H5Fpkg.h" -#include "H5FLprivate.h" #include "H5Iprivate.h" #include "H5Vprivate.h" @@ -84,8 +83,6 @@ typedef struct TEST_free_section_t { H5FS_section_info_t sect_info; /* Free space section information (must be first in struct) */ } TEST_free_section_t; -H5FL_DEFINE(TEST_free_section_t); - static herr_t TEST_sect_init_cls(H5FS_section_class_t *, void *); static herr_t TEST_sect_free(H5FS_section_info_t *_sect); @@ -191,14 +188,6 @@ static herr_t TEST_sects_cb(const H5FS_section_info_t *_sect, void *_udata); /* * Tests */ -static int test_fs_create(hid_t); -static int test_fs_sect_add(hid_t); -static int test_fs_sect_merge(hid_t); -static int test_fs_sect_shrink(hid_t); -static int test_fs_sect_find(hid_t); -static int test_fs_sect_change_class(hid_t); -static int test_fs_sect_extend(hid_t); -static int test_fs_sect_iterate(hid_t); /* * free-space section routines for client TEST @@ -279,12 +268,10 @@ error: * Free the section */ static herr_t -TEST_sect_free(H5FS_section_info_t *_sect) +TEST_sect_free(H5FS_section_info_t *sect) { - TEST_free_section_t *sect = (TEST_free_section_t *)_sect; - /* Release the section */ - H5FL_FREE(TEST_free_section_t, sect); + HDfree(sect); return(0); } /* TEST_sect_free() */ @@ -313,8 +300,8 @@ TEST_sect_can_shrink(const H5FS_section_info_t *_sect, void *_udata) *can_shrink = TRUE; else *can_shrink = FALSE; - return(*can_shrink); + return((htri_t)*can_shrink); } /* TEST_sect_can_shrink() */ /* @@ -448,7 +435,7 @@ error: /* * To verify the creation, close, reopen and deletion of the free-space manager */ -static int +static unsigned test_fs_create(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -476,7 +463,7 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -484,7 +471,7 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* initialize creation parameters for free-space manager */ @@ -540,7 +527,7 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -585,7 +572,7 @@ error: * Result: H5FS_sect_add() will not shrink section A * */ -static int +static unsigned test_fs_sect_add(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -615,7 +602,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -623,27 +610,27 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); nclasses = NELMTS(test_classes); if(NULL == (frsp = H5FS_create(f, H5P_DATASET_XFER_DEFAULT, &fs_addr, - &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) - FAIL_STACK_ERROR + &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) + FAIL_STACK_ERROR if(!H5F_addr_defined(fs_addr)) TEST_ERROR - if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t))) - FAIL_STACK_ERROR + if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t)))) + FAIL_STACK_ERROR init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node, - H5FS_ADD_RETURNED_SPACE, NULL)) - FAIL_STACK_ERROR + H5FS_ADD_RETURNED_SPACE, NULL)) + FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(frspace_state_t)); state.tot_space += sect_node->sect_info.size; @@ -657,7 +644,7 @@ test_fs_sect_add(hid_t fapl) /* Close the free space manager */ if(H5FS_close(f, H5P_DATASET_XFER_DEFAULT, frsp) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR frsp = NULL; /* Close the file */ @@ -665,7 +652,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((tmp_file_size = h5_get_file_size(filename)) < 0) + if((tmp_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR if (tmp_file_size <= (file_size+fr_meta_size)) @@ -676,7 +663,7 @@ test_fs_sect_add(hid_t fapl) TESTING("adding a section via H5FS_sect_add() to free-space with H5FS_CLS_GHOST_OBJ: test 2"); /* Get the size of a file w/empty heap*/ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -684,7 +671,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -692,21 +679,21 @@ test_fs_sect_add(hid_t fapl) init_flags = H5FS_CLS_GHOST_OBJ; if(NULL == (frsp = H5FS_create(f, H5P_DATASET_XFER_DEFAULT, &fs_addr, - &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) - FAIL_STACK_ERROR + &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) + FAIL_STACK_ERROR if(!H5F_addr_defined(fs_addr)) TEST_ERROR /* Create free list section node */ - if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t))) - FAIL_STACK_ERROR + if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t)))) + FAIL_STACK_ERROR init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node, - 0, NULL)) - FAIL_STACK_ERROR + 0, NULL)) + FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(frspace_state_t)); state.tot_space += sect_node->sect_info.size; @@ -720,14 +707,14 @@ test_fs_sect_add(hid_t fapl) /* Close the free space manager */ if(H5FS_close(f, H5P_DATASET_XFER_DEFAULT, frsp) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((tmp_file_size = h5_get_file_size(filename)) < 0) + if((tmp_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR if (tmp_file_size != (file_size+fr_meta_size)) @@ -746,7 +733,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -754,7 +741,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -770,7 +757,7 @@ test_fs_sect_add(hid_t fapl) if(!H5F_addr_defined(fs_addr)) TEST_ERROR - if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR /* @@ -815,7 +802,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file w/empty heap*/ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -823,7 +810,7 @@ test_fs_sect_add(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ @@ -839,7 +826,7 @@ test_fs_sect_add(hid_t fapl) if(!H5F_addr_defined(fs_addr)) TEST_ERROR - if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR /* @@ -910,7 +897,7 @@ error: * Set up: Add section A whose size is less than requested-size * */ -static int +static unsigned test_fs_sect_find(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -937,7 +924,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -986,7 +973,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1007,7 +994,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section C */ - if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1026,7 +1013,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1045,7 +1032,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section D */ - if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1103,7 +1090,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1123,7 +1110,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1176,7 +1163,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1263,7 +1250,7 @@ error: * section A cannot be merged with the merged section of B & C because of different section class type * section D cannot be merged with the merged section of B & C because of different section class type */ -static int +static unsigned test_fs_sect_merge(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1293,7 +1280,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1309,7 +1296,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section C */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1329,7 +1316,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1347,7 +1334,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1365,7 +1352,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section D */ - if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1420,7 +1407,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1437,7 +1424,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1457,7 +1444,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1514,7 +1501,7 @@ test_fs_sect_merge(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1531,7 +1518,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1551,7 +1538,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); @@ -1571,7 +1558,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section C */ - if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); @@ -1589,7 +1576,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section D */ - if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1717,7 +1704,7 @@ error: * Section B is merged with section A and then shrunk. * Result: free-space should be empty */ -static int +static unsigned test_fs_sect_shrink(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1745,7 +1732,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1763,7 +1750,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A that allow shrinking but its section class type does not define "can_shrink" */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); @@ -1797,7 +1784,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Re-add section A that allow shrinking and its section class type defines "can_shrink" */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1844,7 +1831,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1864,7 +1851,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1884,7 +1871,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1944,7 +1931,7 @@ test_fs_sect_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -1963,7 +1950,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -1983,7 +1970,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2055,7 +2042,7 @@ error: * Change section class of B and C to A's section class * Result: the merge list should be null and the class of sections B & C should be changed */ -static int +static unsigned test_fs_sect_change_class(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2082,7 +2069,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2099,7 +2086,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2119,7 +2106,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); @@ -2183,7 +2170,7 @@ test_fs_sect_change_class(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2200,7 +2187,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2212,7 +2199,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); @@ -2224,7 +2211,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section C */ - if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); @@ -2332,7 +2319,7 @@ error: * even though the requested-size is equal to section B's size * */ -static int +static unsigned test_fs_sect_extend(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2356,7 +2343,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* @@ -2375,7 +2362,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2395,7 +2382,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2449,7 +2436,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2469,7 +2456,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2520,7 +2507,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2540,7 +2527,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2592,7 +2579,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2612,7 +2599,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); @@ -2672,7 +2659,7 @@ error: * Iterate through all sections and collect size and count for all sections * Check info with H5FS_sect_stat() */ -static int +static unsigned test_fs_sect_iterate(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2699,7 +2686,7 @@ test_fs_sect_iterate(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR init_cparam(&cparam); @@ -2716,10 +2703,10 @@ test_fs_sect_iterate(hid_t fapl) TEST_ERROR for (i = 1; i <= NUM_SECTIONS; i++) { - if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t))) + if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR - sect_size = ((i-1) % 9) + 1; + sect_size = (unsigned)((i-1) % 9) + 1; init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node, @@ -2768,9 +2755,14 @@ error: int main(void) { - hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ + const char *env_h5_drvr = NULL; /* File Driver value from environment */ + + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if(env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; fapl = h5_fileaccess(); diff --git a/test/h5test.c b/test/h5test.c index 98508ff..03fa3b7 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -541,7 +541,7 @@ h5_fileaccess(void) if (H5Pset_fapl_stdio(fapl)<0) return -1; } else if (!HDstrcmp(name, "core")) { /* In-core temporary file with 1MB increment */ - if (H5Pset_fapl_core(fapl, (size_t)1024*1024, TRUE)<0) return -1; + if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; } else if (!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ if (H5Pset_fapl_split(fapl, @@ -562,13 +562,13 @@ h5_fileaccess(void) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { memb_fapl[mt] = H5P_DEFAULT; sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; - memb_addr[mt] = MAX(mt-1,0)*(HADDR_MAX/10); - } + memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); + } /* end for */ if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE)<0) { @@ -847,20 +847,92 @@ h5_dump_info_object(MPI_Info info) * Programmer: Quincey Koziol * Saturday, March 22, 2003 * - * Modifications: - * Albert Cheng, Oct 11, 2006 - * Changed Failure return value to -1. - * *------------------------------------------------------------------------- */ h5_stat_size_t -h5_get_file_size(const char *filename) +h5_get_file_size(const char *filename, hid_t fapl) { - h5_stat_t sb; + char temp[2048]; /* Temporary buffer for file names */ + h5_stat_t sb; /* Structure for querying file info */ + + if(fapl == H5P_DEFAULT) { + /* Get the file's statistics */ + if(0 == HDstat(filename, &sb)) + return((h5_stat_size_t)sb.st_size); + } /* end if */ + else { + hid_t driver; /* VFD used for file */ - /* Get the file's statistics */ - if (HDstat(filename, &sb)==0) - return((h5_stat_size_t)sb.st_size); + /* Get the driver used when creating the file */ + if((driver = H5Pget_driver(fapl)) < 0) + return(-1); + + /* Check for simple cases */ + if(driver == H5FD_SEC2 || driver == H5FD_STDIO || driver == H5FD_CORE || +#ifdef H5_HAVE_PARALLEL + driver == H5FD_MPIO || driver == H5FD_MPIPOSIX || +#endif /* H5_HAVE_PARALLEL */ +#ifdef H5_HAVE_WINDOWS + driver == H5FD_WINDOWS || +#endif /* H5_HAVE_WINDOWS */ +#ifdef H5_HAVE_DIRECT + driver == H5FD_DIRECT || +#endif /* H5_HAVE_DIRECT */ + driver == H5FD_LOG) { + /* Get the file's statistics */ + if(0 == HDstat(filename, &sb)) + return((h5_stat_size_t)sb.st_size); + } /* end if */ + else if(driver == H5FD_MULTI) { + H5FD_mem_t mt; + h5_stat_size_t tot_size = 0; + + HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { + /* Create the filename to query */ + HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); + + /* Check for existence of file */ + if(0 == HDaccess(temp, F_OK)) { + /* Get the file's statistics */ + if(0 != HDstat(temp, &sb)) + return(-1); + + /* Add to total size */ + tot_size += (h5_stat_size_t)sb.st_size; + } /* end if */ + } /* end for */ + + /* Return total size */ + return(tot_size); + } /* end if */ + else if(driver == H5FD_FAMILY) { + h5_stat_size_t tot_size = 0; + + /* Try all filenames possible, until we find one that's missing */ + for(int j = 0; /*void*/; j++) { + /* Create the filename to query */ + HDsnprintf(temp, sizeof temp, filename, j); + + /* Check for existence of file */ + if(HDaccess(temp, F_OK) < 0) + break; + + /* Get the file's statistics */ + if(0 != HDstat(temp, &sb)) + return(-1); + + /* Add to total size */ + tot_size += (h5_stat_size_t)sb.st_size; + } /* end for */ + + /* Return total size */ + return(tot_size); + } /* end if */ + else { + HDassert(0 && "Unknown VFD!"); + } /* end else */ + } /* end else */ return(-1); } /* end get_file_size() */ diff --git a/test/h5test.h b/test/h5test.h index 04c664e..dd3bb32 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -149,7 +149,7 @@ H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); H5TEST_DLL void h5_show_hostname(void); -H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename); +H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); /* Routines for operating on the list of tests (for the "all in one" tests) */ diff --git a/test/links.c b/test/links.c index 68c7f61..1575ed0 100644 --- a/test/links.c +++ b/test/links.c @@ -696,7 +696,7 @@ long_links(hid_t fapl, hbool_t new_format) if((gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Construct very long file name */ - if((objname = HDmalloc((size_t)(MAX_NAME_LEN + 1))) == NULL) TEST_ERROR + if((objname = (char *)HDmalloc((size_t)(MAX_NAME_LEN + 1))) == NULL) TEST_ERROR for(u = 0; u < MAX_NAME_LEN; u++) objname[u] = 'a'; objname[MAX_NAME_LEN] = '\0'; @@ -3699,7 +3699,8 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) hid_t core_fapl, space, dset, did, dapl_id, dcpl; hsize_t dims[2]; int points[NUM1000][NUM1000]; - int filesize, new_filesize, i, j, n; + h5_stat_size_t filesize, new_filesize; + int i, j, n; if(new_format) TESTING("H5Pset/get_elink_fapl() with same physical layout (w/new group format)") @@ -3753,7 +3754,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if(H5Fclose(fid) < 0) TEST_ERROR /* get size of target file */ - filesize = h5_get_file_size(filename2); + filesize = h5_get_file_size(filename2, core_fapl); /* Create the main file */ if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -3788,16 +3789,17 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) TEST_ERROR - if(H5Pclose(core_fapl) < 0) TEST_ERROR if(H5Pclose(dapl_id) < 0) TEST_ERROR if(H5Dclose(did) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR - new_filesize = h5_get_file_size(filename2); + new_filesize = h5_get_file_size(filename2, core_fapl); /* the file size should remain the same since there is no backing store */ if (new_filesize != filesize) TEST_ERROR + if(H5Pclose(core_fapl) < 0) TEST_ERROR + PASSED(); return 0; @@ -3923,7 +3925,6 @@ external_set_elink_fapl3(hbool_t new_format) H5Pclose(stdio_fapl); } H5E_END_TRY; return -1; - return -1; } /* end external_set_elink_fapl3() */ @@ -5874,7 +5875,7 @@ ud_hard_links(hid_t fapl) /* Get the size of the empty file for reference */ if(H5Fclose(fid) < 0) TEST_ERROR - if((empty_size = h5_get_file_size(filename))<0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl))<0) TEST_ERROR if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -5904,7 +5905,7 @@ ud_hard_links(hid_t fapl) /* Close and re-open file to ensure that data is written to disk */ if(H5Fclose(fid) < 0) TEST_ERROR - if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR /* Open group through UD link */ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -5959,7 +5960,7 @@ ud_hard_links(hid_t fapl) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR /* The file should be empty again. */ - if(empty_size != h5_get_file_size(filename)) TEST_ERROR + if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR @@ -6041,7 +6042,7 @@ ud_link_reregister(hid_t fapl) /* Get the size of the empty file for reference */ if(H5Fclose(fid) < 0) TEST_ERROR - if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR + if((empty_size=h5_get_file_size(filename, fapl))<0) TEST_ERROR if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -6144,7 +6145,7 @@ ud_link_reregister(hid_t fapl) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR /* The file should be empty again. */ - if(empty_size != h5_get_file_size(filename)) TEST_ERROR + if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR if(H5Lis_registered(UD_HARD_TYPE) != FALSE) FAIL_STACK_ERROR @@ -6187,8 +6188,8 @@ UD_cb_create(const char * link_name, hid_t loc_group, const void *udata, if(udata_size > 0 && !udata) TEST_ERROR if(lcpl_id < 0) TEST_ERROR - if(strcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR - if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR + if(HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR + if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR return 0; @@ -6208,8 +6209,8 @@ UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata, if(cur_group < 0) TEST_ERROR if(udata_size > 0 && !udata) TEST_ERROR - if(strcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR - if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR + if(HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR + if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0) @@ -6231,7 +6232,7 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, if(udata_size > 0 && !udata) TEST_ERROR if(HDstrcmp(new_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR - if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR + if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR return 0; @@ -6250,7 +6251,7 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, if(udata_size > 0 && !udata) TEST_ERROR if(HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR - if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR + if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR return 0; @@ -6267,13 +6268,13 @@ UD_cb_query(const char * link_name, const void *udata, size_t udata_size, if(!link_name) TEST_ERROR if(udata_size > 0 && !udata) TEST_ERROR - if(strcmp(link_name, UD_CB_LINK_NAME)) TEST_ERROR - if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR + if(HDstrcmp(link_name, UD_CB_LINK_NAME)) TEST_ERROR + if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR if(buf) { if(buf_size < 16) TEST_ERROR - strcpy(buf, "query succeeded"); + HDstrcpy((char *)buf, "query succeeded"); } /* end if */ /* There are 15 characters and a NULL in "query succeeded" */ @@ -6673,7 +6674,7 @@ UD_cbsucc_query(const char UNUSED *link_name, const void UNUSED *udata, */ if(buf != NULL && buf_size >= 8) - strcpy(buf, "succeed"); + HDstrcpy((char *)buf, "succeed"); return 8; } /* end UD_cbsucc_query() */ @@ -8144,7 +8145,7 @@ corder_transition(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file with an empty group */ - if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -8293,7 +8294,7 @@ corder_transition(hid_t fapl) if(H5Fclose(file_id) < 0) TEST_ERROR /* Get the size of the file now */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR if(file_size != empty_size) TEST_ERROR PASSED(); @@ -8354,7 +8355,7 @@ corder_delete(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of an empty file */ - if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -8419,7 +8420,7 @@ corder_delete(hid_t fapl) } /* end if */ /* Get the size of the file now */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR if(file_size != empty_size) TEST_ERROR } /* end for */ @@ -37,10 +37,8 @@ #include "H5Vprivate.h" #define FILENAME_LEN 1024 -#define TEST_FSPACE_CLIENT_ID 2 #define TEST_BLOCK_SIZE5 5 -#define TEST_BLOCK_SIZE10 10 #define TEST_BLOCK_SIZE20 20 #define TEST_BLOCK_SIZE30 30 #define TEST_BLOCK_SIZE40 40 @@ -54,7 +52,6 @@ #define TEST_BLOCK_SIZE2058 2058 #define TEST_BLOCK_SIZE8000 8000 #define TEST_BLOCK_SIZE2048 2048 -#define TEST_BLOCK_SIZE1024 1024 #define TEST_BLOCK_ADDR70 70 #define TEST_BLOCK_ADDR100 100 @@ -133,7 +130,7 @@ error: * * Allocate two blocks which should be from file allocation */ -static int +static unsigned test_mf_eoa(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -162,7 +159,7 @@ test_mf_eoa(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -174,7 +171,7 @@ test_mf_eoa(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -204,7 +201,7 @@ test_mf_eoa(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -216,7 +213,7 @@ test_mf_eoa(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30); @@ -226,7 +223,7 @@ test_mf_eoa(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -261,7 +258,7 @@ error: * H5MF_try_shrink() the block by 20 from the end: succeed * */ -static int +static unsigned test_mf_eoa_shrink(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -291,7 +288,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -303,7 +300,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -323,7 +320,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -335,7 +332,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -354,7 +351,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -370,7 +367,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -394,7 +391,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -411,7 +408,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -430,7 +427,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -446,7 +443,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -465,7 +462,7 @@ test_mf_eoa_shrink(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -496,7 +493,7 @@ error: * Test 2: Allocate a block of 30 * H5MF_try_extend() the block of size 20 by 50: fail */ -static int +static unsigned test_mf_eoa_extend(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -526,7 +523,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -538,7 +535,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -557,7 +554,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -569,7 +566,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* should succeed */ @@ -587,7 +584,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -603,11 +600,11 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -638,7 +635,7 @@ test_mf_eoa_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -662,7 +659,7 @@ error: * Set up: * Turn off using meta/small data aggregator */ -static int +static unsigned test_mf_fs_start(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -690,7 +687,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -702,7 +699,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Start up free-space manager */ @@ -723,7 +720,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -767,7 +764,7 @@ error: * Deallocate the block which will be returned to free-space manager * (the space is shrunk and freed since it is at end of file) */ -static int +static unsigned test_mf_fs_alloc_free(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -799,7 +796,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -811,7 +808,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -878,7 +875,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -894,7 +891,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -960,7 +957,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -976,7 +973,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1051,11 +1048,11 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ - if (file_size != file_size) + if (new_file_size != file_size) TEST_ERROR PASSED() @@ -1107,7 +1104,7 @@ error: * Fail: section A does not adjoin section B (70+20 != address of section B) even though * the requested-size (50) equal to size of section B (50) */ -static int +static unsigned test_mf_fs_extend(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1140,7 +1137,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Turn off using meta/small data aggregator */ @@ -1152,7 +1149,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1251,7 +1248,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1267,7 +1264,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1361,7 +1358,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1377,7 +1374,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1471,7 +1468,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1487,7 +1484,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1590,7 +1587,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1632,7 +1629,7 @@ error: * section size + remaining size of aggregator is > aggr->alloc_size, * section is allowed to absorb an aggregator (allow_sect_absorb is true) */ -static int +static unsigned test_mf_fs_absorb(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1665,7 +1662,7 @@ test_mf_fs_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1725,7 +1722,7 @@ test_mf_fs_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1808,7 +1805,7 @@ error: * The second block of 50 is allocated from meta_aggr * There is space of 1968 left in meta_aggr */ -static int +static unsigned test_mf_aggr_alloc1(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1834,7 +1831,7 @@ test_mf_aggr_alloc1(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -1842,7 +1839,7 @@ test_mf_aggr_alloc1(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -1866,7 +1863,7 @@ test_mf_aggr_alloc1(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1878,7 +1875,7 @@ test_mf_aggr_alloc1(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Free the two blocks */ @@ -1889,7 +1886,7 @@ test_mf_aggr_alloc1(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -1930,7 +1927,7 @@ error: * The block of 2058 is allocated out of meta_aggr * There is space of 1968 left in meta_aggr */ -static int +static unsigned test_mf_aggr_alloc2(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -1956,7 +1953,7 @@ test_mf_aggr_alloc2(hid_t fapl) FAIL_STACK_ERROR /* Get the size of a file */ - if((file_size= h5_get_file_size(filename)) < 0) + if((file_size= h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -1964,7 +1961,7 @@ test_mf_aggr_alloc2(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -1997,7 +1994,7 @@ test_mf_aggr_alloc2(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2010,7 +2007,7 @@ test_mf_aggr_alloc2(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50+TEST_BLOCK_SIZE2058); @@ -2019,7 +2016,7 @@ test_mf_aggr_alloc2(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2073,7 +2070,7 @@ error: * The fourth block of 50 is allocated from what is left in meta_aggr * There is space of 1968 left in meta_aggr */ -static int +static unsigned test_mf_aggr_alloc3(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2101,7 +2098,7 @@ test_mf_aggr_alloc3(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2109,7 +2106,7 @@ test_mf_aggr_alloc3(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2168,7 +2165,7 @@ test_mf_aggr_alloc3(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2227,7 +2224,7 @@ error: * The block does not adjoin meta_aggr * meta_aggr's info is unchanged */ -static int +static unsigned test_mf_aggr_alloc4(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2253,7 +2250,7 @@ test_mf_aggr_alloc4(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2261,7 +2258,7 @@ test_mf_aggr_alloc4(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2324,7 +2321,7 @@ test_mf_aggr_alloc4(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2364,7 +2361,7 @@ error: * There is space of 2046 left in meta_aggr * */ -static int +static unsigned test_mf_aggr_alloc5(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2390,7 +2387,7 @@ test_mf_aggr_alloc5(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2398,7 +2395,7 @@ test_mf_aggr_alloc5(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2436,7 +2433,7 @@ test_mf_aggr_alloc5(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2486,7 +2483,7 @@ error: * meta_aggr's unused space of [880, 1968] is freed to free-space * meta_aggr is updated to point to the new block */ -static int +static unsigned test_mf_aggr_alloc6(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2513,7 +2510,7 @@ test_mf_aggr_alloc6(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2521,7 +2518,7 @@ test_mf_aggr_alloc6(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -2580,7 +2577,7 @@ test_mf_aggr_alloc6(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2641,7 +2638,7 @@ error: * meta_aggr's unused space of [880, 1968] is freed to free-space * meta_aggr is updated to point to the new block */ -static int +static unsigned test_mf_aggr_alloc7(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2668,7 +2665,7 @@ test_mf_aggr_alloc7(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2676,7 +2673,7 @@ test_mf_aggr_alloc7(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -2753,7 +2750,7 @@ test_mf_aggr_alloc7(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is the correct size */ @@ -2788,7 +2785,7 @@ error: * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request * H5MF_try_extend() fails */ -static int +static unsigned test_mf_aggr_extend(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -2815,7 +2812,7 @@ test_mf_aggr_extend(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -2823,7 +2820,7 @@ test_mf_aggr_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -2872,7 +2869,7 @@ test_mf_aggr_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ @@ -2927,7 +2924,7 @@ test_mf_aggr_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ @@ -3003,7 +3000,7 @@ error: * H5MF_try_shrink() block B should fail since it does not adjoin the * beginning nor the end of meta_aggr */ -static int +static unsigned test_mf_aggr_absorb(hid_t fapl) { hid_t file = -1; /* File ID */ @@ -3032,7 +3029,7 @@ test_mf_aggr_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((empty_size = h5_get_file_size(filename)) < 0) + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ @@ -3040,7 +3037,7 @@ test_mf_aggr_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3072,7 +3069,7 @@ test_mf_aggr_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3116,7 +3113,7 @@ test_mf_aggr_absorb(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ @@ -3195,7 +3192,7 @@ error: * The return address should be aligned * H5MF_try_extend() the block with aligned address should succeed */ -static int +static unsigned test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -3216,7 +3213,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3235,7 +3233,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* get alignment setting */ @@ -3247,11 +3245,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; accum = mis_align + TEST_BLOCK_SIZE30; @@ -3278,7 +3276,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* calculate fragment for alignment of block 50 */ mis_align = 0; - if ((tmp = (file_size + accum) % alignment)) + if ((tmp = ((hsize_t)file_size + accum) % alignment)) mis_align = alignment - tmp; accum += (mis_align + TEST_BLOCK_SIZE50); @@ -3305,7 +3303,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl1)) < 0) TEST_ERROR if (new_file_size != file_size) @@ -3323,13 +3321,14 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Re-open the file with alignment and meta/sdata setting */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 from meta_aggr */ @@ -3343,7 +3342,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl1)) < 0) TEST_ERROR /* Re-open the file */ @@ -3358,7 +3357,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl1)) < 0) TEST_ERROR if (new_file_size != (file_size-TEST_BLOCK_SIZE50)) TEST_ERROR @@ -3375,13 +3374,14 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Re-open the file with alignment and meta/sdata setting */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 */ @@ -3395,7 +3395,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl1)) < 0) TEST_ERROR /* Re-open the file */ @@ -3410,7 +3410,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if((new_file_size = h5_get_file_size(filename)) < 0) + if((new_file_size = h5_get_file_size(filename, fapl1)) < 0) TEST_ERROR if (new_file_size != (file_size+TEST_BLOCK_SIZE30)) TEST_ERROR @@ -3461,7 +3461,7 @@ error: * The free-space manager is unable to fulfill the request * The block is allocated from file allocation and should be aligned */ -static int +static unsigned test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -3498,7 +3498,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -3565,7 +3565,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -3641,8 +3641,9 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { - if((file_size = h5_get_file_size(filename)) < 0) + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if((file_size = h5_get_file_size(filename, new_fapl)) < 0) TEST_ERROR /* Re-open the file with alignment setting */ @@ -3650,7 +3651,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; @@ -3695,7 +3696,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (!(addr >= (haddr_t)file_size)) TEST_ERROR /* calculate fragment for alignment of block 40 from file allocation */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; if (mis_align) { @@ -3823,7 +3824,7 @@ error: * There is space of 2018 left in meta_aggr * EOA is at 20372 */ -static int +static unsigned test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -3844,7 +3845,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3857,7 +3859,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* get alignment setting */ @@ -3869,11 +3871,11 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ @@ -4079,7 +4081,7 @@ error: * There is space of 1968 left in meta_aggr * EOA is at 18432 */ -static int +static unsigned test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -4098,7 +4100,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4111,7 +4114,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* get alignment setting */ @@ -4123,11 +4126,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ @@ -4403,7 +4406,7 @@ error: * The block of 1034 is allocated from the new block and should be aligned * There is space of 1014 left in meta_aggr */ -static int +static unsigned test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -4424,7 +4427,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4437,7 +4441,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* get alignment setting */ @@ -4449,11 +4453,11 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ @@ -4697,7 +4701,7 @@ error: * There is space of 2023 left in meta_aggr * */ -static int +static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -4717,7 +4721,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4730,7 +4735,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file with alignment setting and meta/sdata setting */ @@ -4738,7 +4743,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -4746,7 +4751,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ @@ -4900,7 +4905,7 @@ error: * EOA is 14346 * meta_aggr and sdata_aggr are all 0 */ -static int +static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -4921,7 +4926,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4934,7 +4940,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file with alignment setting and meta/sdata setting */ @@ -4942,7 +4948,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -4950,7 +4956,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ @@ -5167,7 +5173,7 @@ error: * EOA is at 22538 * meta_aggr is unchanged */ -static int +static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { hid_t file = -1; /* File ID */ @@ -5187,7 +5193,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - if(HDstrcmp(env_h5_drvr, "stdio")) { + if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && + HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5200,7 +5207,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file with alignment setting and meta/sdata setting */ @@ -5208,7 +5215,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = H5I_object(file))) + if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5216,7 +5223,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* calculate fragment for alignment of block 30 */ - if ((tmp = file_size % alignment)) + if ((tmp = (hsize_t)file_size % alignment)) mis_align = alignment - tmp; /* Allocate a block of 30 from meta_aggr */ diff --git a/test/stab.c b/test/stab.c index 2b9a84d..56a5571 100644 --- a/test/stab.c +++ b/test/stab.c @@ -342,7 +342,7 @@ lifecycle(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Re-open file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR @@ -491,7 +491,7 @@ lifecycle(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -547,7 +547,7 @@ long_compact(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Construct very long object name template */ if((objname = (char *)HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1))) == NULL) TEST_ERROR @@ -624,7 +624,7 @@ long_compact(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -794,7 +794,7 @@ no_compact(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Re-open file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR @@ -851,7 +851,7 @@ no_compact(hid_t fapl2) if(H5Fclose(fid) < 0) TEST_ERROR /* Get size of file as empty */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1006,7 +1006,7 @@ error: *------------------------------------------------------------------------- */ static int -old_api(hid_t fapl, const char *driver) +old_api(hid_t fapl) { #ifndef H5_NO_DEPRECATED_SYMBOLS hid_t fid = (-1); /* File ID */ @@ -1034,11 +1034,8 @@ old_api(hid_t fapl, const char *driver) /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR - /* Avoid size comparisons if we are using the core VFD */ - if(HDstrcmp(driver, "core")) { - /* Get the size of the file with a "small" heap for group */ - if((small_file_size = h5_get_file_size(filename)) < 0) TEST_ERROR - } /* end if */ + /* Get the size of the file with a "small" heap for group */ + if((small_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Create file */ @@ -1059,20 +1056,16 @@ old_api(hid_t fapl, const char *driver) /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR - /* Avoid size comparisons if we are using the core VFD */ - if(HDstrcmp(driver, "core")) { - /* Get the size of the file with a "large" heap for group */ - if((large_file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + /* Get the size of the file with a "large" heap for group */ + if((large_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR - /* Check that the file with a "large" group heap is actually bigger */ - if(large_file_size <= small_file_size) TEST_ERROR - } /* end if */ + /* Check that the file with a "large" group heap is actually bigger */ + if(large_file_size <= small_file_size) TEST_ERROR PASSED(); #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Shut compiler up */ fapl = fapl; - driver = driver; SKIPPED(); puts(" Deprecated API symbols not enabled"); @@ -1147,7 +1140,7 @@ main(void) nerrors += gcpl_on_root(fapl2); /* Old group API specific tests */ - nerrors += old_api(fapl, envval); + nerrors += old_api(fapl); /* Close 2nd FAPL */ H5Pclose(fapl2); diff --git a/test/tattr.c b/test/tattr.c index caa2d8d..0de9446 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1631,7 +1631,7 @@ test_attr_dtype_shared(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -1770,7 +1770,7 @@ test_attr_dtype_shared(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dtype_shared() */ @@ -2129,7 +2129,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2220,7 +2220,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_create() */ @@ -2260,7 +2260,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2359,7 +2359,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_open() */ @@ -2400,7 +2400,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2537,7 +2537,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_delete() */ @@ -2579,7 +2579,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2696,7 +2696,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_rename() */ @@ -2738,7 +2738,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2826,7 +2826,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_unlink() */ @@ -2866,7 +2866,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2991,7 +2991,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_limits() */ @@ -3559,7 +3559,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -3784,7 +3784,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_big() */ @@ -3825,7 +3825,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -4002,7 +4002,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_null_space() */ @@ -8081,7 +8081,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -8301,7 +8301,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* end for */ @@ -8407,7 +8407,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -8743,7 +8743,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* end for */ @@ -8848,7 +8848,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -9107,7 +9107,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* end for */ @@ -9212,7 +9212,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Get size of file */ - empty_filesize = h5_get_file_size(FILENAME); + empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -9457,7 +9457,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Check size of file */ - filesize = h5_get_file_size(FILENAME); + filesize = h5_get_file_size(FILENAME, fapl); VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* end for */ diff --git a/test/tfile.c b/test/tfile.c index b5f024c..2afade3 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1212,7 +1212,7 @@ test_file_freespace(void) CHECK_I(ret, "H5Fclose"); /* Get the "empty" file size */ - empty_filesize = h5_get_file_size(FILE1); + empty_filesize = h5_get_file_size(FILE1, H5P_DEFAULT); /* Re-open the file (with read-write permission) */ file = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); @@ -1275,7 +1275,7 @@ test_file_freespace(void) CHECK(ret, FAIL, "H5Fclose"); /* Get the file size after modifications*/ - mod_filesize = h5_get_file_size(FILE1); + mod_filesize = h5_get_file_size(FILE1, H5P_DEFAULT); /* Check that the file reverted to empty size */ VERIFY(mod_filesize, empty_filesize, "H5Fget_freespace"); diff --git a/test/tsohm.c b/test/tsohm.c index a586717..94fd128 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -763,7 +763,7 @@ static void test_sohm_size1(void) CHECK_I(ret, "H5Fclose"); /* Get the file size */ - norm_empty_filesize = h5_get_file_size(FILENAME); + norm_empty_filesize = h5_get_file_size(FILENAME, fapl_id); /* Add a bunch of large datatypes to the file */ file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id); @@ -779,7 +779,7 @@ static void test_sohm_size1(void) norm_oh_size = oinfo.hdr.space.total; /* Get the new file size */ - norm_final_filesize = h5_get_file_size(FILENAME); + norm_final_filesize = h5_get_file_size(FILENAME, fapl_id); /* Use the same property list to create a new file. */ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id); @@ -795,7 +795,7 @@ static void test_sohm_size1(void) CHECK_I(ret, "H5Fclose"); /* Get the file size */ - norm_final_filesize2 = h5_get_file_size(FILENAME); + norm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id); @@ -819,7 +819,7 @@ static void test_sohm_size1(void) ret = H5Fclose(file); CHECK_I(ret, "H5Fclose"); - sohm_empty_filesize = h5_get_file_size(FILENAME); + sohm_empty_filesize = h5_get_file_size(FILENAME, fapl_id); /* Add a bunch of datatypes to this file */ file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id); @@ -835,7 +835,7 @@ static void test_sohm_size1(void) sohm_oh_size = oinfo.hdr.space.total; /* Get the new file size */ - sohm_final_filesize = h5_get_file_size(FILENAME); + sohm_final_filesize = h5_get_file_size(FILENAME, fapl_id); /* Use the same property list to create a new file. */ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id); @@ -851,7 +851,7 @@ static void test_sohm_size1(void) CHECK_I(ret, "H5Fclose"); /* Get the file size */ - sohm_final_filesize2 = h5_get_file_size(FILENAME); + sohm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id); @@ -874,7 +874,7 @@ static void test_sohm_size1(void) ret = H5Fclose(file); CHECK_I(ret, "H5Fclose"); - sohm_btree_empty_filesize = h5_get_file_size(FILENAME); + sohm_btree_empty_filesize = h5_get_file_size(FILENAME, fapl_id); /* Add a bunch of datatypes to this file */ file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id); @@ -890,7 +890,7 @@ static void test_sohm_size1(void) sohm_btree_oh_size = oinfo.hdr.space.total; /* Get the new file size */ - sohm_btree_final_filesize = h5_get_file_size(FILENAME); + sohm_btree_final_filesize = h5_get_file_size(FILENAME, fapl_id); /* Use the same property list to create a new file. */ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id); @@ -906,7 +906,7 @@ static void test_sohm_size1(void) CHECK_I(ret, "H5Fclose"); /* Get the file size */ - sohm_btree_final_filesize2 = h5_get_file_size(FILENAME); + sohm_btree_final_filesize2 = h5_get_file_size(FILENAME, fapl_id); @@ -1441,7 +1441,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Fclose"); /* Get the file size */ - ret_sizes->empty_size = h5_get_file_size(FILENAME); + ret_sizes->empty_size = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Re-open the file and set up messages to write */ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); @@ -1544,9 +1544,9 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Get the file's size now */ if(x == 0) - ret_sizes->first_dset = h5_get_file_size(FILENAME); + ret_sizes->first_dset = h5_get_file_size(FILENAME, H5P_DEFAULT); else - ret_sizes->second_dset = h5_get_file_size(FILENAME); + ret_sizes->second_dset = h5_get_file_size(FILENAME, H5P_DEFAULT); file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); CHECK_I(file_id, "H5Fopen"); @@ -1561,7 +1561,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size /* Close file and get its size now */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - ret_sizes->dsets1 = h5_get_file_size(FILENAME); + ret_sizes->dsets1 = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Now create a new group filled with datasets that use all different messages */ @@ -1602,7 +1602,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - ret_sizes->dsets2 = h5_get_file_size(FILENAME); + ret_sizes->dsets2 = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Create a new group and interleave writes of datasets types 1 and 2. */ @@ -1656,7 +1656,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - ret_sizes->interleaved = h5_get_file_size(FILENAME); + ret_sizes->interleaved = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Create lots of new attribute messages on the group * (using different strings for the attribute) @@ -1699,7 +1699,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - ret_sizes->attrs1 = h5_get_file_size(FILENAME); + ret_sizes->attrs1 = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Create all of the attributes again on the other group */ @@ -1738,7 +1738,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size CHECK_I(ret, "H5Gclose"); ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - ret_sizes->attrs2 = h5_get_file_size(FILENAME); + ret_sizes->attrs2 = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Close everything */ @@ -2723,7 +2723,7 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id) /* Close file and get filesize */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - norm_filesize = h5_get_file_size(FILENAME); + norm_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Create a new file with messages 0 to (HALF_DELETE_NUM_MESGS - 1) */ file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); @@ -2755,7 +2755,7 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id) /* Close file and get filesize */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - deleted_filesize = h5_get_file_size(FILENAME); + deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT); /* The two filesizes should be almost the same */ if(norm_filesize > deleted_filesize * OVERHEAD_ALLOWED) @@ -2950,7 +2950,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id) /* Close the file and get its size */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - initial_filesize = h5_get_file_size(FILENAME); + initial_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT); /* Re-create the file and create a dataset in it */ @@ -2969,7 +2969,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id) /* Close the file and get its size */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - deleted_filesize = h5_get_file_size(FILENAME); + deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT); VERIFY(deleted_filesize, initial_filesize, "h5_get_file_size"); @@ -2999,7 +2999,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id) /* Close the file and get its size */ ret = H5Fclose(file_id); CHECK_I(ret, "H5Fclose"); - deleted_filesize = h5_get_file_size(FILENAME); + deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT); VERIFY(deleted_filesize, initial_filesize, "h5_get_file_size"); diff --git a/test/unlink.c b/test/unlink.c index 868f765..e03323f 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -44,8 +44,6 @@ const char *FILENAME[] = { NULL }; -#define THE_OBJECT "/foo" - /* Macros for test_create_unlink() & test_filespace */ #define GROUPNAME "group" #define GROUP2NAME "group2" @@ -564,7 +562,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /* Get the size of an empty file */ - if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Create common objects for datasets */ @@ -602,7 +600,7 @@ test_filespace(hid_t fapl) if((space = H5Screate_simple(FILESPACE_NDIMS, dims, NULL)) < 0) TEST_ERROR /* Create buffer for writing dataset */ - if((data = HDmalloc(sizeof(int)*FILESPACE_DIM0*FILESPACE_DIM1*FILESPACE_DIM2))==NULL) TEST_ERROR + if(NULL == (data = (int *)HDmalloc(sizeof(int) * FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2))) TEST_ERROR /* Create single dataset (with contiguous storage & late allocation), remove it & verify file size */ @@ -622,7 +620,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -647,7 +645,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -672,7 +670,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -697,7 +695,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -722,7 +720,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -746,7 +744,7 @@ test_filespace(hid_t fapl) for(u = 0; u < FILESPACE_REWRITE; u++) { /* Set buffer to some compressible values */ for(v = 0, tmp_data = data; v < (FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2); v++) - *tmp_data++ = v * u; + *tmp_data++ = (int)(v * u); /* Write the buffer to the dataset */ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR @@ -769,7 +767,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl_nocache)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -794,7 +792,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -858,7 +856,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -886,7 +884,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -911,7 +909,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -943,7 +941,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -973,7 +971,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1063,7 +1061,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1098,7 +1096,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1132,7 +1130,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1170,7 +1168,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1220,7 +1218,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1517,7 +1515,7 @@ test_unlink_rightleaf(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1580,7 +1578,7 @@ test_unlink_rightnode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1643,7 +1641,7 @@ test_unlink_middlenode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2165,7 +2163,7 @@ test_full_group_compact(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file with only the objects to keep */ - if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -2229,7 +2227,7 @@ test_full_group_compact(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != keep_size) TEST_ERROR @@ -2299,7 +2297,7 @@ test_full_group_dense(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file with only the objects to keep */ - if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -2375,7 +2373,7 @@ test_full_group_dense(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != keep_size) TEST_ERROR @@ -2419,7 +2417,7 @@ main(void) envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; - if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { + if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { hid_t fapl, fapl2, file; int nerrors = 0; char filename[1024]; |