summaryrefslogtreecommitdiffstats
path: root/test/cmpd_dset.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmpd_dset.c')
-rw-r--r--test/cmpd_dset.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 460c8ae..227b0c3 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -450,9 +450,12 @@ test_select_src_subset(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fill
hsize_t dims[2] = {NX, NY};
hsize_t chunk_dims[2] = {NX / 10, NY / 10};
unsigned char *rew_buf = NULL, *save_rew_buf = NULL, *rbuf = NULL;
- int fillvalue = (-1);
+ stype1 fillvalue;
size_t ss, ss1, ss2;
+ /* Initialize the fill value */
+ memset(&fillvalue, 0, sizeof(stype1));
+
/* Create the file for this test */
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
@@ -625,9 +628,12 @@ test_select_dst_subset(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fill
hsize_t dims[2] = {NX, NY};
hsize_t chunk_dims[2] = {NX / 10, NY / 10};
unsigned char *rew_buf = NULL, *save_rew_buf = NULL, *rbuf = NULL;
- int fillvalue = (-1);
+ stype2 fillvalue;
size_t ss, ss1, ss2;
+ /* Initialize the fill value */
+ memset(&fillvalue, 0, sizeof(stype2));
+
/* Create the file for this test */
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
@@ -810,17 +816,22 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva
/* Other variables */
unsigned int i;
- hid_t fid = H5I_INVALID_HID;
- hid_t did = H5I_INVALID_HID;
- hid_t sid = H5I_INVALID_HID;
- hid_t dcpl = H5I_INVALID_HID;
- hid_t dxpl = H5I_INVALID_HID;
- hid_t array_dt = H5I_INVALID_HID;
- static hsize_t dim[] = {NX, NY};
- int fillvalue = (-1);
+ hid_t fid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
+ hid_t dxpl = H5I_INVALID_HID;
+ hid_t array_dt = H5I_INVALID_HID;
+ static hsize_t dim[] = {NX, NY};
+ s1_t fillvalue1;
+ s7_t fillvalue7;
size_t ss = 0, ss1 = 0, ss2 = 0;
hsize_t memb_size[1] = {4};
+ /* Initialize the fill values */
+ memset(&fillvalue1, 0, sizeof(s1_t));
+ memset(&fillvalue7, 0, sizeof(s7_t));
+
/* Allocate buffers */
if (NULL == (s1 = (s1_t *)calloc(NX * NY, sizeof(s1_t))))
goto error;
@@ -900,7 +911,7 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva
/* Set fill value accordingly */
if (set_fillvalue) {
- if (H5Pset_fill_value(dcpl, s1_tid, &fillvalue) < 0)
+ if (H5Pset_fill_value(dcpl, s1_tid, &fillvalue1) < 0)
goto error;
}
@@ -1022,7 +1033,7 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva
/* Set fill value accordingly */
if (set_fillvalue) {
- if (H5Pset_fill_value(dcpl, s7_tid, &fillvalue) < 0)
+ if (H5Pset_fill_value(dcpl, s7_tid, &fillvalue7) < 0)
goto error;
}
@@ -1115,6 +1126,7 @@ test_select_compound(char *fname, hid_t fapl, hid_t in_dxpl, unsigned set_fillva
/* Release buffers */
free(s1);
+ free(save_s1);
free(s3);
free(save_s3);
free(rbuf1);
@@ -1145,30 +1157,19 @@ error:
H5E_END_TRY
/* Release resources */
- if (s1)
- free(s1);
- if (s3)
- free(s3);
- if (save_s3)
- free(save_s3);
- if (rbuf1)
- free(rbuf1);
- if (rbuf3)
- free(rbuf3);
- if (s7)
- free(s7);
- if (save_s7)
- free(save_s7);
- if (s8)
- free(s8);
- if (save_s8)
- free(save_s8);
- if (rbuf7)
- free(rbuf7);
- if (rbuf8)
- free(rbuf8);
- if (save_rbuf8)
- free(save_rbuf8);
+ free(s1);
+ free(save_s1);
+ free(s3);
+ free(save_s3);
+ free(rbuf1);
+ free(rbuf3);
+ free(s7);
+ free(save_s7);
+ free(s8);
+ free(save_s8);
+ free(rbuf7);
+ free(rbuf8);
+ free(save_rbuf8);
printf("\n*** SELECT COMPOUND DATASET TESTS FAILED ***\n");
return 1;