summaryrefslogtreecommitdiffstats
path: root/test/freespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/freespace.c')
-rw-r--r--test/freespace.c404
1 files changed, 180 insertions, 224 deletions
diff --git a/test/freespace.c b/test/freespace.c
index 39c5688..33a6f89 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -23,6 +23,8 @@
/* Other private headers that this test requires */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5Fpkg.h"
+
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
#include "H5VMprivate.h"
@@ -446,7 +448,6 @@ static unsigned
test_fs_create(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -486,13 +487,10 @@ test_fs_create(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -512,12 +510,12 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr,
+ if(NULL == (frsp = H5FS_open(f, fs_addr,
nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -527,12 +525,12 @@ test_fs_create(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -548,10 +546,6 @@ test_fs_create(hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- /* Close the dxpl */
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR;
-
PASSED()
return 0;
@@ -559,9 +553,8 @@ test_fs_create(hid_t fapl)
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_create() */
@@ -595,7 +588,6 @@ static unsigned
test_fs_sect_add(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl_id (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -636,13 +628,10 @@ test_fs_sect_add(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -654,7 +643,7 @@ test_fs_sect_add(hid_t fapl)
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, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -669,7 +658,7 @@ test_fs_sect_add(hid_t fapl)
fr_meta_size = H5FS_HEADER_SIZE(f) + H5FS_SINFO_PREFIX_SIZE(f);
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
@@ -704,7 +693,7 @@ test_fs_sect_add(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_GHOST_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -717,7 +706,7 @@ test_fs_sect_add(hid_t fapl)
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, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
0, NULL) < 0)
FAIL_STACK_ERROR
@@ -732,7 +721,7 @@ test_fs_sect_add(hid_t fapl)
fr_meta_size = H5FS_HEADER_SIZE(f);
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -776,7 +765,7 @@ test_fs_sect_add(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = 0;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -791,7 +780,7 @@ test_fs_sect_add(hid_t fapl)
*/
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -802,12 +791,12 @@ test_fs_sect_add(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -845,7 +834,7 @@ test_fs_sect_add(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = 0;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -860,7 +849,7 @@ test_fs_sect_add(hid_t fapl)
*/
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_DESERIALIZING, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -872,7 +861,7 @@ test_fs_sect_add(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -881,20 +870,18 @@ test_fs_sect_add(hid_t fapl)
sect_node = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -905,9 +892,8 @@ error:
if(sect_node)
TEST_sect_free((H5FS_section_info_t *)sect_node);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_add() */
@@ -937,7 +923,6 @@ static unsigned
test_fs_sect_find(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -967,13 +952,10 @@ test_fs_sect_find(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -985,7 +967,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -995,7 +977,7 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
@@ -1004,7 +986,7 @@ test_fs_sect_find(hid_t fapl)
TESTING("H5FS_sect_find() a section equal to requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1021,7 +1003,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1042,7 +1024,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1061,7 +1043,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1080,7 +1062,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1091,7 +1073,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1104,11 +1086,11 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
/* remove sections A, C and D */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node3) < 0)
FAIL_STACK_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node4) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1123,7 +1105,7 @@ test_fs_sect_find(hid_t fapl)
sect_node4 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
@@ -1132,7 +1114,7 @@ test_fs_sect_find(hid_t fapl)
TESTING("H5FS_sect_find() a section greater than requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1149,7 +1131,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1169,7 +1151,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1180,7 +1162,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1194,7 +1176,7 @@ test_fs_sect_find(hid_t fapl)
node = NULL;
/* remove sections A */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1203,7 +1185,7 @@ test_fs_sect_find(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
@@ -1212,7 +1194,7 @@ test_fs_sect_find(hid_t fapl)
TESTING("H5FS_sect_find(): cannot find a section with requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1229,7 +1211,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1241,14 +1223,14 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* remove sections A */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1257,20 +1239,18 @@ test_fs_sect_find(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -1285,9 +1265,8 @@ error:
if(sect_node4)
TEST_sect_free((H5FS_section_info_t *)sect_node4);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_find() */
@@ -1329,7 +1308,6 @@ static unsigned
test_fs_sect_merge(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -1362,13 +1340,10 @@ test_fs_sect_merge(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1383,7 +1358,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1403,7 +1378,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1421,7 +1396,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1439,7 +1414,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1451,7 +1426,7 @@ test_fs_sect_merge(hid_t fapl)
/* should be able to find the merged section of A, B, C & D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1464,12 +1439,12 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -1496,7 +1471,7 @@ test_fs_sect_merge(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1511,7 +1486,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1531,7 +1506,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1544,17 +1519,17 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should not be able to find the merged section of A & B */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* remove section A from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* remove section B from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1566,12 +1541,12 @@ test_fs_sect_merge(hid_t fapl)
sect_node2 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -1598,7 +1573,7 @@ test_fs_sect_merge(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = 0; /* reset */
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1613,7 +1588,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1633,7 +1608,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1653,7 +1628,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1671,7 +1646,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1687,14 +1662,14 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should not be able to find a merged section of A, B, C & D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* should be able to find the merged section of B & C */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1708,7 +1683,7 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should be able to find section A */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1721,7 +1696,7 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should be able to find section D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1734,20 +1709,18 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -1760,8 +1733,7 @@ error:
if(sect_node2)
TEST_sect_free((H5FS_section_info_t *)sect_node2);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
- H5Pclose(dxpl_id);
+ H5FS_close(f, frsp);
H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1805,7 +1777,6 @@ static unsigned
test_fs_sect_shrink(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -1838,13 +1809,10 @@ test_fs_sect_shrink(hid_t fapl)
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1860,7 +1828,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
can_shrink = FALSE;
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1873,7 +1841,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should still be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1894,7 +1862,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
can_shrink = FALSE;
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1905,19 +1873,19 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -1945,7 +1913,7 @@ test_fs_sect_shrink(hid_t fapl)
/* does not allow merging */
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1960,7 +1928,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1980,7 +1948,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1989,7 +1957,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section B should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2001,7 +1969,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should still be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2014,12 +1982,12 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2045,7 +2013,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
init_flags = 0; /* reset */
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2060,7 +2028,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -2080,7 +2048,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -2090,7 +2058,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section B should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2098,27 +2066,25 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -2127,9 +2093,8 @@ test_fs_sect_shrink(hid_t fapl)
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_shrink() */
@@ -2155,7 +2120,6 @@ static unsigned
test_fs_sect_change_class(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2184,14 +2148,11 @@ test_fs_sect_change_class(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
init_flags = H5FS_CLS_GHOST_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2206,7 +2167,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2226,7 +2187,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2237,7 +2198,7 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node1,
TEST_FSPACE_SECT_TYPE_NONE) < 0)
TEST_ERROR
@@ -2246,7 +2207,7 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2256,7 +2217,7 @@ test_fs_sect_change_class(hid_t fapl)
if(TEST_sect_free((H5FS_section_info_t *)node) < 0)
TEST_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -2265,12 +2226,12 @@ test_fs_sect_change_class(hid_t fapl)
sect_node2 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2297,7 +2258,7 @@ test_fs_sect_change_class(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2312,7 +2273,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2324,7 +2285,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2336,17 +2297,17 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* change the class of B to A's class */
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node2,
TEST_FSPACE_SECT_TYPE) < 0)
TEST_ERROR
/* change the class of C to A's class */
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node3,
TEST_FSPACE_SECT_TYPE) < 0)
TEST_ERROR
@@ -2356,7 +2317,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section B has changed class */
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2367,7 +2328,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section C has changed class */
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2378,7 +2339,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* remove section A from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -2387,20 +2348,18 @@ test_fs_sect_change_class(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -2413,9 +2372,8 @@ error:
if(sect_node2)
TEST_sect_free((H5FS_section_info_t *)sect_node2);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_change_class() */
@@ -2455,7 +2413,6 @@ static unsigned
test_fs_sect_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2479,11 +2436,8 @@ test_fs_sect_extend(hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
/*
* TEST 1
@@ -2491,7 +2445,7 @@ test_fs_sect_extend(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2506,7 +2460,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2526,7 +2480,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2538,7 +2492,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend a block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
FAIL_STACK_ERROR
if(FALSE == status)
TEST_ERROR
@@ -2551,12 +2505,12 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2567,7 +2521,7 @@ test_fs_sect_extend(hid_t fapl)
*/
TESTING("a block's extension by requested-size which is > adjoining free section's size: Test 2");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2582,7 +2536,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2602,7 +2556,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2614,7 +2568,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0)
FAIL_STACK_ERROR
if(TRUE == status)
TEST_ERROR
@@ -2624,12 +2578,12 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2640,7 +2594,7 @@ test_fs_sect_extend(hid_t fapl)
*/
TESTING("a block's extension by requested-size which is < adjoining free section's size: Test 3");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2655,7 +2609,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2675,7 +2629,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2687,7 +2641,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0)
TEST_ERROR
if(FALSE == status)
TEST_ERROR
@@ -2698,12 +2652,12 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2714,7 +2668,7 @@ test_fs_sect_extend(hid_t fapl)
*/
TESTING("a block's extension by requested-size which does not adjoin any free section: Test 4");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2729,7 +2683,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2749,7 +2703,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2761,7 +2715,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
TEST_ERROR
if(TRUE == status)
TEST_ERROR
@@ -2771,12 +2725,12 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2785,17 +2739,14 @@ test_fs_sect_extend(hid_t fapl)
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
return 0;
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_extend() */
@@ -2813,7 +2764,6 @@ static unsigned
test_fs_sect_iterate(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2845,14 +2795,11 @@ test_fs_sect_iterate(hid_t fapl)
udata.tot_size = 0;
udata.tot_sect_count = 0;
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2866,12 +2813,12 @@ test_fs_sect_iterate(hid_t fapl)
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, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
- if(H5FS_sect_iterate(f, dxpl_id, frsp, TEST_sects_cb, &udata) < 0)
+ if(H5FS_sect_iterate(f, frsp, TEST_sects_cb, &udata) < 0)
TEST_ERROR
H5FS_sect_stats(frsp, &tot_space, &nsects);
@@ -2882,20 +2829,18 @@ test_fs_sect_iterate(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file and dxpl */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
PASSED()
@@ -2904,9 +2849,8 @@ test_fs_sect_iterate(hid_t fapl)
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_iterate() */
@@ -2918,6 +2862,7 @@ 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 */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -2931,6 +2876,10 @@ main(void)
PUTS_ERROR("Can't get VFD-dependent fapl")
} /* end if */
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* make sure alignment is not set for tests to succeed */
if(H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1) < 0) {
nerrors++;
@@ -2953,6 +2902,10 @@ main(void)
goto error;
HDputs("All free-space tests passed.");
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
h5_cleanup(FILENAME, fapl);
HDexit(EXIT_SUCCESS);
@@ -2961,6 +2914,9 @@ error:
H5E_BEGIN_TRY {
H5Pclose(fapl);
} H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
HDexit(EXIT_FAILURE);
} /* main() */