summaryrefslogtreecommitdiffstats
path: root/test/fheap.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-19 13:45:15 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-19 13:45:15 (GMT)
commit3e9980d20d8ffe15430aea182f05196b5da59db3 (patch)
tree6c9c77e283015087631c015283fb2105be88be86 /test/fheap.c
parent23656c7877deca5f84908102f90fa9f05c7d7995 (diff)
parent66a94df13b3801547523f1ea90bc84fe2ee6824b (diff)
downloadhdf5-3e9980d20d8ffe15430aea182f05196b5da59db3.zip
hdf5-3e9980d20d8ffe15430aea182f05196b5da59db3.tar.gz
hdf5-3e9980d20d8ffe15430aea182f05196b5da59db3.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit '66a94df13b3801547523f1ea90bc84fe2ee6824b': Removed UIUC from copyright, added helpful comment. Updated MANIFEST Added a config file for ARM (Tested on a Raspberry Pi 3B+ w/ gcc 6). Tidying from code review. Fixed stack and frame size warnings. Not complete, but fixes most of the easier cases.
Diffstat (limited to 'test/fheap.c')
-rw-r--r--test/fheap.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/fheap.c b/test/fheap.c
index 2cd2be3..b8c54d6 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -7617,7 +7617,8 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
haddr_t fh_addr; /* Address of fractal heap */
- unsigned char heap_id[100][MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */
+ unsigned char **heap_id = NULL;
+ unsigned char *heap_id_data = NULL;
struct a_type_t1 {
char a[10];
char b[40];
@@ -7629,6 +7630,14 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
+ /* Set up data array */
+ if(NULL == (heap_id_data = (unsigned char *)HDcalloc(100 * MAX_HEAP_ID_LEN, sizeof(unsigned char))))
+ TEST_ERROR;
+ if(NULL == (heap_id = (unsigned char **)HDcalloc(100, sizeof(heap_id_data))))
+ TEST_ERROR;
+ for (i = 0; i < 100; i++)
+ heap_id[i] = heap_id_data + (i * MAX_HEAP_ID_LEN);
+
/* Create the file to work on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, tparam->my_fcpl, fapl)) < 0)
FAIL_STACK_ERROR
@@ -7695,7 +7704,10 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* All tests passed */
PASSED()
- return(0);
+ HDfree(heap_id);
+ HDfree(heap_id_data);
+
+ return 0;
error:
H5E_BEGIN_TRY {
@@ -7703,7 +7715,11 @@ error:
H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
- return(1);
+
+ HDfree(heap_id);
+ HDfree(heap_id_data);
+
+ return 1;
} /* test_man_incr_insert_remove() */
#endif /* QAK */