summaryrefslogtreecommitdiffstats
path: root/test/fheap.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-15 17:32:01 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:50 (GMT)
commit0585e6fb342014ac83598137f9bf0e946c701cd5 (patch)
treef8d126f92281c133aeb7fd4cba853d8ef68442d5 /test/fheap.c
parentd11be7974e5253715bc6cb9e6cc58cbaf9281971 (diff)
downloadhdf5-0585e6fb342014ac83598137f9bf0e946c701cd5.zip
hdf5-0585e6fb342014ac83598137f9bf0e946c701cd5.tar.gz
hdf5-0585e6fb342014ac83598137f9bf0e946c701cd5.tar.bz2
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 a846ee5..e6e6c47 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -7614,7 +7614,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];
@@ -7626,6 +7627,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
@@ -7692,7 +7701,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 {
@@ -7700,7 +7712,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 */