diff options
Diffstat (limited to 'test/earray.c')
-rw-r--r-- | test/earray.c | 719 |
1 files changed, 366 insertions, 353 deletions
diff --git a/test/earray.c b/test/earray.c index 1058565..6597afd 100644 --- a/test/earray.c +++ b/test/earray.c @@ -20,13 +20,15 @@ * This file needs to access private datatypes from the H5EA package. * This file also needs to access the extensible array testing code. */ -#define H5EA_FRIEND /*suppress error about including H5EApkg */ +#define H5EA_FRIEND /*suppress error about including H5EApkg */ #define H5EA_TESTING -#include "H5EApkg.h" /* Extensible Arrays */ +#include "H5EApkg.h" /* Extensible Arrays */ /* Other private headers that this test requires */ -#include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Iprivate.h" /* IDs */ +#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ @@ -171,16 +173,16 @@ char filename_g[EARRAY_FILENAME_LEN]; /* Empty file size */ h5_stat_size_t empty_size_g; - + /*------------------------------------------------------------------------- - * Function: init_cparam + * Function: init_cparam * - * Purpose: Initialize array creation parameter structure + * Purpose: Initialize array creation parameter structure * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 21, 2008 * *------------------------------------------------------------------------- @@ -203,18 +205,18 @@ init_cparam(H5EA_create_t *cparam) return(0); } /* init_cparam() */ - + /*------------------------------------------------------------------------- - * Function: init_tparam + * Function: init_tparam * - * Purpose: Initialize array testing parameter structure + * Purpose: Initialize array testing parameter structure * - * Note: This initialization is the same as that in H5EA_hdr_init() + * Note: This initialization is the same as that in H5EA_hdr_init() * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 25, 2008 * *------------------------------------------------------------------------- @@ -253,16 +255,16 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) return(0); } /* init_tparam() */ - + /*------------------------------------------------------------------------- - * Function: finish_tparam + * Function: finish_tparam * - * Purpose: Close down array testing parameter structure + * Purpose: Close down array testing parameter structure * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 25, 2008 * *------------------------------------------------------------------------- @@ -277,16 +279,16 @@ finish_tparam(earray_test_param_t *tparam) return(0); } /* finish_tparam() */ - + /*------------------------------------------------------------------------- - * Function: create_file + * Function: create_file * - * Purpose: Create file and retrieve pointer to internal file object + * Purpose: Create file and retrieve pointer to internal file object * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -299,7 +301,7 @@ create_file(unsigned flags, hid_t fapl, hid_t *file, H5F_t **f) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -313,16 +315,16 @@ error: return(-1); } /* create_file() */ - + /*------------------------------------------------------------------------- - * Function: check_stats + * Function: check_stats * - * Purpose: Verify stats for an extensible array + * Purpose: Verify stats for an extensible array * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 21, 2008 * *------------------------------------------------------------------------- @@ -391,22 +393,22 @@ error: return(-1); } /* check_stats() */ - + /*------------------------------------------------------------------------- - * Function: reopen_file + * Function: reopen_file * - * Purpose: Perform common "re-open" operations on file & array for testing + * Purpose: Perform common "re-open" operations on file & array for testing * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- */ 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, H5EA_t **ea, haddr_t ea_addr, const earray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -414,7 +416,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, if(tparam->reopen_array) { /* Close array, if given */ if(ea && *ea) { - if(H5EA_close(*ea, dxpl) < 0) + if(H5EA_close(*ea) < 0) FAIL_STACK_ERROR *ea = NULL; } /* end if */ @@ -432,7 +434,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (*f = (H5F_t *)H5I_object(*file))) + if(NULL == (*f = (H5F_t *)H5VL_object(*file))) FAIL_STACK_ERROR /* Ignore metadata tags in the file's cache */ @@ -441,7 +443,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, /* Re-open array, if given */ if(ea) - if(NULL == (*ea = H5EA_open(*f, dxpl, ea_addr, NULL))) + if(NULL == (*ea = H5EA_open(*f, ea_addr, NULL))) FAIL_STACK_ERROR } /* end if */ @@ -452,29 +454,29 @@ error: return(-1); } /* reopen_file() */ - + /*------------------------------------------------------------------------- - * Function: create_array + * Function: create_array * - * Purpose: Create an extensible array and perform initial checks + * Purpose: Create an extensible array and perform initial checks * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- */ static int -create_array(H5F_t *f, hid_t dxpl, const H5EA_create_t *cparam, +create_array(H5F_t *f, const H5EA_create_t *cparam, H5EA_t **ea, haddr_t *ea_addr, H5EA__ctx_cb_t *cb) { hsize_t nelmts; /* Number of elements in array */ earray_state_t state; /* State of extensible array */ /* Create array */ - if(NULL == (*ea = H5EA_create(f, dxpl, cparam, cb))) + if(NULL == (*ea = H5EA_create(f, cparam, cb))) FAIL_STACK_ERROR /* Check status of array */ @@ -499,16 +501,16 @@ error: return(-1); } /* create_array() */ - + /*------------------------------------------------------------------------- - * Function: verify_cparam + * Function: verify_cparam * - * Purpose: Verify creation parameters are correct + * Purpose: Verify creation parameters are correct * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -520,31 +522,31 @@ verify_cparam(const H5EA_t *ea, const H5EA_create_t *cparam) /* Retrieve creation parameters */ HDmemset(&test_cparam, 0, sizeof(H5EA_create_t)); - if(H5EA_get_cparam_test(ea, &test_cparam) < 0) + if(H5EA__get_cparam_test(ea, &test_cparam) < 0) FAIL_STACK_ERROR /* Verify creation parameters */ - if(H5EA_cmp_cparam_test(cparam, &test_cparam)) + if(H5EA__cmp_cparam_test(cparam, &test_cparam)) TEST_ERROR /* Success */ - return(0); + return SUCCEED; error: - return(-1); + return FAIL; } /* verify_cparam() */ - + /*------------------------------------------------------------------------- - * Function: finish + * Function: finish * - * Purpose: Close array, delete array, close file and verify that file + * Purpose: Close array, delete array, close file and verify that file * is empty size * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -555,7 +557,7 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) h5_stat_size_t file_size; /* File size, after deleting array */ /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR #ifdef QAK @@ -565,7 +567,7 @@ HDsystem("cp earray.h5 earray.h5.save"); #endif /* QAK */ /* Delete array */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -588,16 +590,16 @@ error: return(-1); } /* finish() */ - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Test creating extensible array + * Purpose: Test creating extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 7, 2008 * *------------------------------------------------------------------------- @@ -605,8 +607,8 @@ error: static unsigned test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -627,11 +629,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.raw_elmt_size = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -642,11 +644,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -656,11 +658,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 65; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -671,11 +673,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -684,11 +686,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 1; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -697,11 +699,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 6; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -712,11 +714,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.data_blk_min_elmts = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -728,11 +730,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -742,11 +744,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = 4; /* corresponds to 16 elements in data block page, which is less than the 64 elements for the default settings */ H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -755,18 +757,18 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(test_cparam.max_nelmts_bits + 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ TEST_ERROR } /* end if */ - PASSED() + PASSED(); } #else /* NDEBUG */ SKIPPED(); @@ -779,10 +781,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE TESTING("extensible array creation"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR - PASSED() + PASSED(); /* Verify the creation parameters */ TESTING("verify array creation parameters"); @@ -796,30 +798,30 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); - H5Fclose(file); + H5EA_close(ea); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_create() */ - + /*------------------------------------------------------------------------- - * Function: test_reopen + * Function: test_reopen * - * Purpose: Create & reopen an extensible array + * Purpose: Create & reopen an extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -827,8 +829,8 @@ error: static unsigned test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -842,19 +844,19 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("create, close & reopen extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 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 == (ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -866,30 +868,30 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); - H5Fclose(file); + H5EA_close(ea); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_reopen() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice + * Function: test_open_twice * - * Purpose: Open an extensible array twice + * Purpose: Open an extensible array twice * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -897,10 +899,10 @@ error: static unsigned test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -915,11 +917,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("open extensible array twice"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -929,12 +931,12 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -942,11 +944,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -954,7 +956,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -970,35 +972,35 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); - H5Fclose(file); - H5Fclose(file2); + H5EA_close(ea2); + H5Fclose(file); + H5Fclose(file2); } H5E_END_TRY; return 1; } /* test_open_twice() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice_diff + * Function: test_open_twice_diff * - * Purpose: Open an extensible array twice, through different "top" file + * Purpose: Open an extensible array twice, through different "top" file * handles, with an intermediate file open that takes the "shared" * file handle from the first extensible array's file pointer. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, December 18, 2015 * *------------------------------------------------------------------------- @@ -1007,12 +1009,12 @@ static unsigned test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { char filename_tmp[EARRAY_FILENAME_LEN]; /* Temporary file name */ - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - hid_t file0 = -1; /* File ID */ - hid_t file00 = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + hid_t file0 = -1; /* File ID */ + hid_t file00 = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -1027,11 +1029,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TESTING("open extensible array twice, through different file handles"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1041,7 +1043,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; @@ -1053,7 +1055,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_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, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1061,7 +1063,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -1088,11 +1090,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f2 = (H5F_t *)H5I_object(file2))) + if(NULL == (f2 = (H5F_t *)H5VL_object(file2))) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1110,35 +1112,35 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); - H5Fclose(file); - H5Fclose(file2); - H5Fclose(file0); - H5Fclose(file00); + H5EA_close(ea2); + H5Fclose(file); + H5Fclose(file2); + H5Fclose(file0); + H5Fclose(file00); } H5E_END_TRY; return 1; } /* test_open_twice_diff() */ - + /*------------------------------------------------------------------------- - * Function: test_delete_open + * Function: test_delete_open * - * Purpose: Delete opened extensible array (& open deleted array) + * Purpose: Delete opened extensible array (& open deleted array) * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 28, 2008 * *------------------------------------------------------------------------- @@ -1146,8 +1148,8 @@ error: static unsigned test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ H5EA_t *ea2 = NULL; /* Extensible array wrapper */ haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */ @@ -1163,15 +1165,15 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("deleting open extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Request that the array be deleted */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1181,38 +1183,38 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Try re-opening the array again (should fail, as array will be deleted) */ H5E_BEGIN_TRY { - ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea2 = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea2) { /* Close opened array */ - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = 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 { - ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea) { /* Close opened array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); /* Indicate error */ TEST_ERROR @@ -1231,17 +1233,17 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); - H5Fclose(file); + H5EA_close(ea2); + H5Fclose(file); } H5E_END_TRY; return 1; @@ -1253,16 +1255,16 @@ typedef struct eiter_fw_t { unsigned base_sblk_idx; /* Starting index for actual superblocks */ } eiter_fw_t; - + /*------------------------------------------------------------------------- - * Function: eiter_fw_init + * Function: eiter_fw_init * - * Purpose: Initialize element interator (forward iteration) + * Purpose: Initialize element interator (forward iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 2, 2008 * *------------------------------------------------------------------------- @@ -1285,16 +1287,16 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para return(eiter); } /* end eiter_fw_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_next + * Function: eiter_fw_next * - * Purpose: Get next element index (forward iteration) + * Purpose: Get next element index (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1314,16 +1316,16 @@ eiter_fw_next(void *_eiter) return(ret_val); } /* end eiter_fw_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_max + * Function: eiter_fw_max * - * Purpose: Get max. element index (forward iteration) + * Purpose: Get max. element index (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1342,14 +1344,14 @@ eiter_fw_max(const void *_eiter) /*------------------------------------------------------------------------- - * Function: eiter_fw_state + * Function: eiter_fw_state * - * Purpose: Get extensible array state (forward iteration) + * Purpose: Get extensible array state (forward iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1414,16 +1416,16 @@ HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); return(0); } /* end eiter_fw_state() */ - + /*------------------------------------------------------------------------- - * Function: eiter_fw_term + * Function: eiter_fw_term * - * Purpose: Shut down element interator (forward iteration) + * Purpose: Shut down element interator (forward iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 2, 2008 * *------------------------------------------------------------------------- @@ -1459,16 +1461,16 @@ typedef struct eiter_rv_t { hsize_t idx_blk_nsblks; /* Number of superblocks directly pointed to in the index block */ } eiter_rv_t; - + /*------------------------------------------------------------------------- - * Function: eiter_rv_init + * Function: eiter_rv_init * - * Purpose: Initialize element interator (reverse iteration) + * Purpose: Initialize element interator (reverse iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1503,16 +1505,16 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, return(eiter); } /* end eiter_rv_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_next + * Function: eiter_rv_next * - * Purpose: Get next element index (reverse iteration) + * Purpose: Get next element index (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1532,16 +1534,16 @@ eiter_rv_next(void *_eiter) return(ret_val); } /* end eiter_rv_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_max + * Function: eiter_rv_max * - * Purpose: Get max. element index (reverse iteration) + * Purpose: Get max. element index (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1558,16 +1560,16 @@ eiter_rv_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_rv_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_state + * Function: eiter_rv_state * - * Purpose: Get extensible array state (reverse iteration) + * Purpose: Get extensible array state (reverse iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1656,16 +1658,16 @@ HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eit return(0); } /* end eiter_rv_state() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rv_term + * Function: eiter_rv_term * - * Purpose: Shut down element interator (reverse iteration) + * Purpose: Shut down element interator (reverse iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 4, 2008 * *------------------------------------------------------------------------- @@ -1698,16 +1700,16 @@ typedef struct eiter_rnd_t { hsize_t *idx; /* Array of shuffled indices */ } eiter_rnd_t; - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_init + * Function: eiter_rnd_init * - * Purpose: Initialize element interator (random iteration) + * Purpose: Initialize element interator (random iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1750,16 +1752,16 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par return(eiter); } /* end eiter_rnd_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_next + * Function: eiter_rnd_next * - * Purpose: Get next element index (random iteration) + * Purpose: Get next element index (random iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1784,16 +1786,16 @@ eiter_rnd_next(void *_eiter) return(ret_val); } /* end eiter_rnd_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_max + * Function: eiter_rnd_max * - * Purpose: Get max. element index (random iteration) + * Purpose: Get max. element index (random iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1810,16 +1812,16 @@ eiter_rnd_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_rnd_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_rnd_term + * Function: eiter_rnd_term * - * Purpose: Shut down element interator (random iteration) + * Purpose: Shut down element interator (random iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 6, 2008 * *------------------------------------------------------------------------- @@ -1851,16 +1853,16 @@ static const earray_iter_t ea_iter_rnd = { eiter_rnd_term /* Iterator term */ }; - + /*------------------------------------------------------------------------- - * Function: eiter_rnd2_init + * Function: eiter_rnd2_init * - * Purpose: Initialize element interator (random #2 iteration) + * Purpose: Initialize element interator (random #2 iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 11, 2008 * *------------------------------------------------------------------------- @@ -1935,16 +1937,16 @@ typedef struct eiter_cyc_t { hsize_t cyc; /* Cycle of elements to choose from */ } eiter_cyc_t; - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_init + * Function: eiter_cyc_init * - * Purpose: Initialize element interator (cyclic iteration) + * Purpose: Initialize element interator (cyclic iteration) * - * Return: Success: Pointer to iteration status object - * Failure: NULL + * Return: Success: Pointer to iteration status object + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -1969,16 +1971,16 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par return(eiter); } /* end eiter_cyc_init() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_next + * Function: eiter_cyc_next * - * Purpose: Get next element index (cyclic iteration) + * Purpose: Get next element index (cyclic iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2005,16 +2007,16 @@ eiter_cyc_next(void *_eiter) return(ret_val); } /* end eiter_cyc_next() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_max + * Function: eiter_cyc_max * - * Purpose: Get max. element index (cyclic iteration) + * Purpose: Get max. element index (cyclic iteration) * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2031,16 +2033,16 @@ eiter_cyc_max(const void *_eiter) return((hssize_t)eiter->max); } /* end eiter_cyc_max() */ - + /*------------------------------------------------------------------------- - * Function: eiter_cyc_term + * Function: eiter_cyc_term * - * Purpose: Shut down element interator (cyclic iteration) + * Purpose: Shut down element interator (cyclic iteration) * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2068,16 +2070,16 @@ static const earray_iter_t ea_iter_cyc = { eiter_cyc_term /* Iterator term */ }; - + /*------------------------------------------------------------------------- - * Function: test_set_elmts + * Function: test_set_elmts * - * Purpose: Set all elements from 0 through 'nelmts' in extensible array + * Purpose: Set all elements from 0 through 'nelmts' in extensible array * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 22, 2008 * *------------------------------------------------------------------------- @@ -2086,8 +2088,8 @@ static unsigned test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t nelmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ void *eiter_info; /* Extensible array iterator info */ earray_state_t state; /* State of extensible array */ @@ -2111,7 +2113,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2119,7 +2121,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2150,7 +2152,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2178,7 +2180,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2187,7 +2189,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Get the max. array index */ @@ -2215,7 +2217,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2232,30 +2234,30 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); - H5Fclose(file); + H5EA_close(ea); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_set_elmts() */ - + /*------------------------------------------------------------------------- - * Function: test_skip_elmts + * Function: test_skip_elmts * - * Purpose: Skip some elements when writing element + * Purpose: Skip some elements when writing element * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 11, 2008 * *------------------------------------------------------------------------- @@ -2264,8 +2266,8 @@ static unsigned test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, hsize_t skip_elmts, const char *test_str) { - hid_t file = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file object pointer */ H5EA_t *ea = NULL; /* Extensible array wrapper */ earray_state_t state; /* State of extensible array */ uint64_t welmt; /* Element to write */ @@ -2285,7 +2287,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2293,7 +2295,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2314,7 +2316,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2323,7 +2325,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Verify high-water # of elements written */ @@ -2365,7 +2367,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2376,7 +2378,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, for(cnt = 0; cnt < skip_elmts; cnt++) { /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0) + if(H5EA_get(ea, cnt, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2389,30 +2391,30 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); - H5Fclose(file); + H5EA_close(ea); + H5Fclose(file); } H5E_END_TRY; return 1; } /* test_skip_elmts() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test the extensible array code + * Purpose: Test the extensible array code * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 17, 2008 * *------------------------------------------------------------------------- @@ -2424,28 +2426,33 @@ main(void) earray_test_param_t tparam; /* Testing parameters */ earray_test_type_t curr_test; /* Current test being worked on */ earray_iter_type_t curr_iter; /* Current iteration type being worked on */ - hid_t fapl = -1; /* File access property list for data files */ - unsigned nerrors = 0; /* Cumulative error count */ + hid_t fapl = -1; /* File access property list for data files */ + unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ - int ExpressMode; /* Test express value */ + int ExpressMode; /* Test express value */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); /* 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); /* Create an empty file to retrieve size */ { - hid_t file; /* File ID */ + hid_t file; /* File ID */ if((file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR @@ -2464,7 +2471,7 @@ main(void) init_cparam(&cparam); /* Iterate over the testing parameters */ - for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; H5_INC_ENUM(earray_test_type_t, curr_test)) { + for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; curr_test++) { /* Initialize the testing parameters */ init_tparam(&tparam, &cparam); @@ -2496,7 +2503,7 @@ main(void) nerrors += test_delete_open(fapl, &cparam, &tparam); /* Iterate over the type of capacity tests */ - for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; H5_INC_ENUM(earray_iter_type_t, curr_iter)) { + for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; curr_iter++) { hsize_t sblk; /* Super block index */ hsize_t dblk; /* Data block index */ hsize_t nelmts; /* # of elements to test */ @@ -2553,14 +2560,14 @@ main(void) nelmts = (hsize_t)((hsize_t)1 + cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * dblk)); - sprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks); + HDsprintf(test_str, "setting first element of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Test all elements in data block */ nelmts = (hsize_t)(cparam.idx_blk_elmts + tparam.sblk_info[sblk].start_idx + (tparam.sblk_info[sblk].dblk_nelmts * (dblk + 1))); - sprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks); + HDsprintf(test_str, "setting all elements of array's data block #%llu", (unsigned long long)ndblks); nerrors += test_set_elmts(fapl, &cparam, &tparam, nelmts, test_str); /* Increment data block being tested */ @@ -2585,6 +2592,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; HDputs("All extensible array tests passed."); @@ -2601,6 +2612,8 @@ error: H5Pclose(fapl); } H5E_END_TRY; + if(api_ctx_pushed) H5CX_pop(); + return 1; } /* end main() */ |