summaryrefslogtreecommitdiffstats
path: root/test/farray.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-04-29 08:04:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-04-29 08:04:21 (GMT)
commit01f196b31a03f072b685f998b0805c1f90322c2b (patch)
tree6e1cae004705ade1c870e4c6612a76b55be3c331 /test/farray.c
parentda4b69097756158fdbfcbf52b5b552e2034d263d (diff)
parentb3c5284692093953132c6c8227e0980b670bf4ad (diff)
downloadhdf5-01f196b31a03f072b685f998b0805c1f90322c2b.zip
hdf5-01f196b31a03f072b685f998b0805c1f90322c2b.tar.gz
hdf5-01f196b31a03f072b685f998b0805c1f90322c2b.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_hyperslab_updates
Diffstat (limited to 'test/farray.c')
-rw-r--r--test/farray.c148
1 files changed, 79 insertions, 69 deletions
diff --git a/test/farray.c b/test/farray.c
index e84bfae..383cb32 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -5,12 +5,10 @@
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
@@ -27,8 +25,9 @@
#include "H5FApkg.h" /* Fixed Arrays */
/* Other private headers that this test requires */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Local macros */
@@ -267,7 +266,7 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
+reopen_file(hid_t *file, H5F_t **f, hid_t fapl,
H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam)
{
/* Check for closing & re-opening the array */
@@ -275,7 +274,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
if(tparam->reopen_array) {
/* Close array, if given */
if(fa && *fa) {
- if(H5FA_close(*fa, dxpl) < 0)
+ if(H5FA_close(*fa) < 0)
FAIL_STACK_ERROR
*fa = NULL;
} /* end if */
@@ -302,7 +301,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
/* Re-open array, if given */
if(fa)
- if(NULL == (*fa = H5FA_open(*f, dxpl, fa_addr, NULL)))
+ if(NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
FAIL_STACK_ERROR
} /* end if */
@@ -325,13 +324,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-create_array(H5F_t *f, hid_t dxpl, const H5FA_create_t *cparam,
+create_array(H5F_t *f, const H5FA_create_t *cparam,
H5FA_t **fa, haddr_t *fa_addr)
{
farray_state_t state; /* State of extensible array */
/* Create array */
- if(NULL == (*fa = H5FA_create(f, dxpl, cparam, NULL)))
+ if(NULL == (*fa = H5FA_create(f, cparam, NULL)))
FAIL_STACK_ERROR
/* Check status of array */
@@ -402,11 +401,11 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
h5_stat_size_t file_size; /* File size, after deleting array */
/* Close the fixed array */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Delete array */
- if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0)
+ if(H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -464,11 +463,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.raw_elmt_size = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
@@ -479,11 +478,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
@@ -494,11 +493,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.nelmts = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
@@ -518,7 +517,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
TESTING("fixed array creation");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
PASSED()
@@ -542,7 +541,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -578,19 +577,19 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TESTING("create, close & reopen fixed array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Close the fixed array */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Re-open the array */
- if(NULL == (fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -609,7 +608,7 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -648,11 +647,11 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TESTING("open fixed array twice");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -662,12 +661,12 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
@@ -679,7 +678,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
FAIL_STACK_ERROR
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -687,7 +686,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -710,9 +709,9 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa2);
H5Fclose(file);
H5Fclose(file2);
} H5E_END_TRY;
@@ -760,11 +759,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -774,7 +773,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
@@ -786,11 +785,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Close the first fixed array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -821,7 +820,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
FAIL_STACK_ERROR
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -846,9 +845,9 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa2);
H5Fclose(file);
H5Fclose(file2);
H5Fclose(file0);
@@ -889,15 +888,15 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TESTING("deleting open fixed array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Request that the array be deleted */
- if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0)
+ if(H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -907,38 +906,38 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Try re-opening the array again (should fail, as array will be deleted) */
H5E_BEGIN_TRY {
- fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL);
+ fa2 = H5FA_open(f, fa_addr, NULL);
} H5E_END_TRY;
if(fa2) {
/* Close opened array */
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa2);
/* Indicate error */
TEST_ERROR
} /* end if */
/* Close the first fixed array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Try re-opening the array again (should fail, as array is now deleted) */
H5E_BEGIN_TRY {
- fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL);
+ fa = H5FA_open(f, fa_addr, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
/* Indicate error */
TEST_ERROR
@@ -964,9 +963,9 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa2);
H5Fclose(file);
} H5E_END_TRY;
@@ -1393,7 +1392,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -1401,7 +1400,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
if(H5FA_get_nelmts(fa, &fa_nelmts) < 0)
@@ -1433,7 +1432,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1460,7 +1459,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
idx = (hsize_t)sidx;
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved element is correct */
@@ -1469,12 +1468,12 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5FA_set(fa, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved element is correct */
@@ -1504,7 +1503,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -1548,7 +1547,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -1556,7 +1555,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
if(H5FA_get_nelmts(fa, &fa_nelmts) < 0)
@@ -1578,7 +1577,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1587,7 +1586,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5FA_set(fa, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Verify array state */
@@ -1598,7 +1597,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1610,7 +1609,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
for(cnt = 0; cnt < skip_elmts; cnt++) {
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0)
+ if(H5FA_get(fa, cnt, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1631,7 +1630,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -1660,6 +1659,7 @@ main(void)
unsigned nerrors = 0; /* Cumulative error count */
time_t curr_time; /* Current time, for seeding random number generator */
int ExpressMode; /* Test express value */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Reset library */
h5_reset();
@@ -1671,6 +1671,10 @@ main(void)
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Seed random #'s */
curr_time = HDtime(NULL);
HDsrandom((unsigned)curr_time);
@@ -1790,6 +1794,10 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
puts("All fixed array tests passed.");
@@ -1806,6 +1814,8 @@ error:
H5Pclose(fapl);
} H5E_END_TRY;
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */