summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2016-10-24 21:06:56 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2016-10-24 21:06:56 (GMT)
commit12a26c2374d01076c34005d458cf0970a9cf30b1 (patch)
treedecb2dcd1569c19e7a0a4d5b97aa048ca8478fb4 /hl/test
parentf3171aec7a5205d6b3145b26b7ff3007db939b10 (diff)
downloadhdf5-12a26c2374d01076c34005d458cf0970a9cf30b1.zip
hdf5-12a26c2374d01076c34005d458cf0970a9cf30b1.tar.gz
hdf5-12a26c2374d01076c34005d458cf0970a9cf30b1.tar.bz2
Description:
- Merged my commits to develop that fixed HDFFV-9758: b3b7ae087edbc20891a088db2f4e4f83e186c8b0 14e308b2e6eada778818abf53949ceef0e7b2a34 - Merged a commit from trunk by Quincey: commit ec2fbe0883f9e76df60bcfbebbd4b6f62d5a09e6 Author: Quincey Koziol <koziol@hdfgroup.org> Date: Thu Jul 7 13:54:11 2016 -0500 [svn-r30158] Description: More warning cleanups. This brings us down to ~1300 warnings in 167 Tested on: MacOSX/64 10.11.5 (amazon) w/serial & parallel (h5committest forthcoming) Platforms tested: Linux/32 2.6 (jam) Darwin (osx1010test)
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/test_packet_vlen.c386
1 files changed, 192 insertions, 194 deletions
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 82c8d1c..b152a2c 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -28,7 +28,6 @@
#define PT_COMP_VLEN "Dataset with Compound Type of VL types"
#define PT_VLEN_VLEN "Dataset with VL of VL types"
#define PT_FIXED_LEN "Fixed-length Packet Table"
-#define SPACE3_RANK 1
#define L1_INCM 16
#define L2_INCM 8
#define NAME_BUF_SIZE 80
@@ -60,7 +59,7 @@ static int test_VLof_atomic(void)
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -69,15 +68,15 @@ static int test_VLof_atomic(void)
TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(unsigned int));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++)
- ((unsigned int *)writeBuf[ii].p)[jj] = ii * 10 + jj;
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++)
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
@@ -119,12 +118,12 @@ static int test_VLof_atomic(void)
if (ret < 0)
goto error;
- for (ii = 0; ii < NRECORDS; ii++)
- for (jj=0; jj<(ii+1); jj++)
+ for (uu = 0; uu < NRECORDS; uu++)
+ for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[ii].p)[jj] != ((unsigned int *)writeBuf[ii].p)[jj]) {
- printf("Packet %d's value should be %d\n", ii, ((unsigned int *)writeBuf[ii].p)[jj]);
- printf("Packet %d's value in readBuf is %d\n", ii, ((unsigned int *)readBuf[ii].p)[jj]);
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -149,6 +148,7 @@ static int test_VLof_atomic(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vltype > 0) H5Tclose(vltype);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -168,7 +168,7 @@ static int test_VLof_comptype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
} VLcomp_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
@@ -178,23 +178,23 @@ static int test_VLof_comptype(void)
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret;
TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(VLcomp_t));
- if(writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ if(writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++) {
- ((VLcomp_t *)writeBuf[ii].p)[jj].i = ii+jj;
- ((VLcomp_t *)writeBuf[ii].p)[jj].f = (float)((ii+jj)/3.0F);
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++) {
+ ((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
+ ((VLcomp_t *)writeBuf[uu].p)[vv].f = (float)(uu + vv) / 3.0F;
} /* end for */
} /* end for */
@@ -209,7 +209,7 @@ static int test_VLof_comptype(void)
goto error;
/* Insert fields */
- ret = H5Tinsert(cmptype, "i", HOFFSET(VLcomp_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
@@ -228,7 +228,9 @@ static int test_VLof_comptype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release the datatypes */
+ if (H5Tclose(cmptype) < 0)
+ goto error;
if (H5Tclose(vltype) < 0)
goto error;
@@ -251,15 +253,15 @@ static int test_VLof_comptype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].len != readBuf[ii].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].len=%d, readBuf[%d].len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].len,(int)ii,(int)readBuf[ii].len);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].len != readBuf[uu].len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
continue;
} /* write len != read len */
- for (jj=0; jj<(ii+1); jj++) {
- if (((unsigned int *)writeBuf[ii].p)[jj] != ((unsigned int *)readBuf[ii].p)[jj] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[ii].p[%d]=%d, readBuf[ii].p[%d]=%d\n",(int)jj, (int)((unsigned int *)writeBuf[ii].p)[jj], (int)jj, (int)((unsigned int *)readBuf[ii].p)[jj]);
+ for (vv = 0; vv < (uu + 1); vv++) {
+ if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -286,6 +288,8 @@ static int test_VLof_comptype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (cmptype > 0) H5Tclose(cmptype);
+ if (vltype > 0) H5Tclose(vltype);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -306,48 +310,46 @@ static int test_compound_VL_VLtype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
hvl_t v;
} compVLVL_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t space=H5I_INVALID_HID; /* Dataspace identifier */
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
a VL of VL of atomic datatype */
- hsize_t dims1[] = {NRECORDS};
hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].i = ii*10;
- writeBuf[ii].f = (float)((ii*20)/3.0F);
- writeBuf[ii].v.p = HDmalloc((ii+L1_INCM)*sizeof(hvl_t));
- if (writeBuf[ii].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].u = uu * 10;
+ writeBuf[uu].f = (float)(uu * 20) / 3.0F;
+ writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ if (writeBuf[uu].v.p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].v.len=ii+L1_INCM;
- for (t1=(hvl_t *)((writeBuf[ii].v).p), jj=0; jj<(ii+L1_INCM); jj++, t1++)
+ writeBuf[uu].v.len = uu + L1_INCM;
+ for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
{
- t1->p = HDmalloc((jj+L2_INCM)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+L2_INCM;
- for (kk=0; kk<jj+L2_INCM; kk++)
- ((unsigned int*)t1->p)[kk] = ii*100 + jj*10 + kk;
+ t1->len = vv + L2_INCM;
+ for (ww = 0; ww < vv + L2_INCM; ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
}
} /* end for */
@@ -356,11 +358,6 @@ static int test_compound_VL_VLtype(void)
if (fid < 0)
goto error;
- /* Create dataspace for datasets */
- space = H5Screate_simple(SPACE3_RANK, dims1, NULL);
- if (space < 0)
- goto error;
-
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
@@ -377,7 +374,7 @@ static int test_compound_VL_VLtype(void)
goto error;
/* Insert fields: atomic, atomic, vlen */
- ret = H5Tinsert(comp_vlvl, "i", HOFFSET(compVLVL_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
@@ -394,7 +391,11 @@ static int test_compound_VL_VLtype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release datatypes */
+ if (H5Tclose(vlatomic) < 0)
+ goto error;
+ if (H5Tclose(vlofvl) < 0)
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
goto error;
@@ -417,29 +418,29 @@ static int test_compound_VL_VLtype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].i != readBuf[ii].i) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%d].i=%d, readBuf[%d].i=%d\n",(int)ii,(int)writeBuf[ii].i,(int)ii,(int)readBuf[ii].i);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].u != readBuf[uu].u) {
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
- if (!H5_FLT_ABS_EQUAL(writeBuf[ii].f,readBuf[ii].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%d].f=%f, readBuf[%d].f=%f\n",(int)ii,(double)writeBuf[ii].f,(int)ii,(double)readBuf[ii].f);
+ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f,readBuf[uu].f)) {
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
- if (writeBuf[ii].v.len != readBuf[ii].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%d, readBuf[%d].v.len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].v.len,(int)ii,(int)readBuf[ii].v.len);
+ if (writeBuf[uu].v.len != readBuf[uu].v.len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
- for (t1=(hvl_t *)(writeBuf[ii].v.p), t2=(hvl_t *)(readBuf[ii].v.p), jj=0; (size_t)jj<readBuf[ii].v.len; jj++, t1++, t2++) {
+ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, ii=%d, jj=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)ii,(int)jj,(int)t1->len,(int)t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
- for (kk=0; (size_t)kk<t2->len; kk++) {
- if (((unsigned int *)t1->p)[kk] != ((unsigned int *)t2->p)[kk] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)kk, (int)((unsigned int *)t1->p)[kk], (int)kk, (int)((unsigned int *)t2->p)[kk]);
+ for (ww = 0; (size_t)ww < t2->len; ww++) {
+ if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -459,12 +460,6 @@ static int test_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- /* Release datatypes */
- if (H5Tclose(vlatomic) < 0)
- goto error;
- if (H5Tclose(vlofvl) < 0)
- goto error;
-
/* Close the file */
if (H5Fclose(fid) < 0)
goto error;
@@ -473,6 +468,9 @@ static int test_compound_VL_VLtype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vlatomic > 0) H5Tclose(vlatomic);
+ if (vlofvl > 0) H5Tclose(vlofvl);
+ if (comp_vlvl > 0) H5Tclose(comp_vlvl);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -497,7 +495,7 @@ static int test_VLof_VLtype(void)
hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
hvl_t *t1; /* pointer to advance */
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -506,23 +504,23 @@ static int test_VLof_VLtype(void)
TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii< NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(hvl_t));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
- writeBuf[ii].len = ii+1;
- for (t1=(hvl_t *)(writeBuf[ii].p), jj=0; jj<(ii+1); jj++, t1++)
+ writeBuf[uu].len = uu + 1;
+ for (t1=(hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
{
- t1->p = HDmalloc((jj+1)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+1;
- for (kk=0; kk<(jj+1); kk++)
- ((unsigned int *)t1->p)[kk] = ii*100+jj*10+kk;
+ t1->len = vv * 1;
+ for (ww = 0; ww < (vv * 1); ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
} /* end for */
} /* end for */
@@ -547,7 +545,9 @@ static int test_VLof_VLtype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release datatypes */
+ if (H5Tclose(vlatomic) < 0)
+ goto error;
if (H5Tclose(vlofvl) < 0)
goto error;
@@ -590,6 +590,8 @@ static int test_VLof_VLtype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vlatomic > 0) H5Tclose(vlatomic);
+ if (vlofvl > 0) H5Tclose(vlofvl);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -771,6 +773,10 @@ static int adding_attribute(hid_t fid, const char *table_name, const char *attr_
if (H5Aclose(attr_id) < 0)
goto error;
+ /* Close the dataspace */
+ if (H5Sclose(space_id) < 0)
+ goto error;
+
/* Close the packet table */
if (H5PTclose(ptable) < 0)
goto error;
@@ -778,6 +784,8 @@ static int adding_attribute(hid_t fid, const char *table_name, const char *attr_
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (attr_id > 0) H5Aclose(attr_id);
+ if (space_id > 0) H5Sclose(space_id);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
return ret;
} /* adding_attribute */
@@ -792,19 +800,12 @@ error: /* An error has occurred. Clean up and exit. */
static herr_t verify_attribute(hid_t fid, const char *table_name, const char *attr_name)
{
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t space_id=H5I_INVALID_HID; /* Dataspace for the attribute */
hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
- hsize_t dims[] = {ATTR_DIM}; /* Dimensions for dataspace */
int read_data[ATTR_DIM]; /* Output buffer */
int ii;
herr_t ret = FAIL; /* Returned status from a callee */
- /* Create dataspace for attribute */
- space_id = H5Screate_simple(ATTR_RANK, dims, NULL);
- if (space_id < 0)
- goto error;
-
/* Open the named packet table */
ptable = H5PTopen(fid, table_name);
if (ptable < 0)
@@ -907,7 +908,7 @@ static int test_attributes(void)
return(ret);
error: /* An error has occurred. Clean up and exit. */
- H5Fclose(fid);
+ if (fid > 0) H5Fclose(fid);
H5_FAILED();
return FAIL;
} /* test_attributes */
@@ -929,9 +930,8 @@ error: /* An error has occurred. Clean up and exit. */
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
-static herr_t verify_accessors(const char *table_name, herr_t expected_value)
+static herr_t verify_accessors(hid_t fid, const char *table_name, herr_t expected_value)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
hid_t dtype_id=H5I_INVALID_HID; /* Dataset identifier */
@@ -940,11 +940,6 @@ static herr_t verify_accessors(const char *table_name, herr_t expected_value)
herr_t is_varlen = 0;
herr_t ret = FAIL; /* Returned status from a callee */
- /* Open the file. */
- fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
- if (fid < 0)
- goto error;
-
/* Open the named packet table. */
ptable = H5PTopen(fid, table_name);
if (ptable < 0)
@@ -958,6 +953,8 @@ static herr_t verify_accessors(const char *table_name, herr_t expected_value)
/* Check if the packet table's name matches its associated dataset's. */
*buf = '\0';
name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE);
+ if (name_size < 0)
+ goto error;
VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match");
/* Get the packet table's datatype ID */
@@ -991,7 +988,8 @@ static herr_t verify_accessors(const char *table_name, herr_t expected_value)
error: /* An error has occurred. Clean up and exit. */
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
- return ret;
+ H5_FAILED();
+ return FAIL;
} /* verify_accessors */
/*-------------------------------------------------------------------------
@@ -1007,7 +1005,6 @@ error: /* An error has occurred. Clean up and exit. */
static int test_accessors(void)
{
hid_t fid=H5I_INVALID_HID; /* File identifier */
- hid_t ptable=H5I_INVALID_HID; /* File identifier */
herr_t ret = FAIL; /* Returned status from a callee */
TESTING("accessor functions");
@@ -1017,11 +1014,11 @@ static int test_accessors(void)
if (fid < 0)
goto error;
- ret = verify_accessors(PT_VLEN_ATOMIC, TRUE);
+ ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE);
if (ret < 0)
goto error;
- ret = verify_accessors(PT_FIXED_LEN, FALSE);
+ ret = verify_accessors(fid, PT_FIXED_LEN, FALSE);
if (ret < 0)
goto error;
@@ -1033,7 +1030,6 @@ static int test_accessors(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
- if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5_FAILED();
return FAIL;
@@ -1059,7 +1055,7 @@ static int testfl_VLof_atomic(void)
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -1068,15 +1064,15 @@ static int testfl_VLof_atomic(void)
TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(unsigned int));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++)
- ((unsigned int *)writeBuf[ii].p)[jj] = ii * 10 + jj;
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++)
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
@@ -1118,12 +1114,12 @@ static int testfl_VLof_atomic(void)
if (ret < 0)
goto error;
- for (ii = 0; ii < NRECORDS; ii++)
- for (jj=0; jj<(ii+1); jj++)
+ for (uu = 0; uu < NRECORDS; uu++)
+ for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[ii].p)[jj] != ((unsigned int *)writeBuf[ii].p)[jj]) {
- printf("Packet %d's value should be %d\n", ii, ((unsigned int *)writeBuf[ii].p)[jj]);
- printf("Packet %d's value in readBuf is %d\n", ii, ((unsigned int *)readBuf[ii].p)[jj]);
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -1148,6 +1144,7 @@ static int testfl_VLof_atomic(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vltype > 0) H5Tclose(vltype);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -1167,7 +1164,7 @@ static int testfl_VLof_comptype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
} VLcomp_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
@@ -1177,23 +1174,23 @@ static int testfl_VLof_comptype(void)
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
hsize_t count; /* Number of records in the table */
- int ii, jj; /* Loop variables */
+ unsigned uu, vv; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret;
TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(VLcomp_t));
- if(writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ if(writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].len = ii+1;
- for (jj=0; jj<(ii+1); jj++) {
- ((VLcomp_t *)writeBuf[ii].p)[jj].i = ii+jj;
- ((VLcomp_t *)writeBuf[ii].p)[jj].f = (float)((ii+jj)/3.0F);
+ writeBuf[uu].len = uu + 1;
+ for (vv = 0; vv < (uu + 1); vv++) {
+ ((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
+ ((VLcomp_t *)writeBuf[uu].p)[vv].f = (float)(uu + vv) / 3.0F;
} /* end for */
} /* end for */
@@ -1208,7 +1205,7 @@ static int testfl_VLof_comptype(void)
goto error;
/* Insert fields */
- ret = H5Tinsert(cmptype, "i", HOFFSET(VLcomp_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
@@ -1227,7 +1224,9 @@ static int testfl_VLof_comptype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release the datatypes */
+ if (H5Tclose(cmptype) < 0)
+ goto error;
if (H5Tclose(vltype) < 0)
goto error;
@@ -1250,15 +1249,15 @@ static int testfl_VLof_comptype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].len != readBuf[ii].len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].len=%d, readBuf[%d].len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].len,(int)ii,(int)readBuf[ii].len);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].len != readBuf[uu].len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
continue;
} /* write len != read len */
- for (jj=0; jj<(ii+1); jj++) {
- if (((unsigned int *)writeBuf[ii].p)[jj] != ((unsigned int *)readBuf[ii].p)[jj] ) {
- fprintf(stderr, "VL data values don't match!, writeBuf[ii].p[%d]=%d, readBuf[ii].p[%d]=%d\n",(int)jj, (int)((unsigned int *)writeBuf[ii].p)[jj], (int)jj, (int)((unsigned int *)readBuf[ii].p)[jj]);
+ for (vv = 0; vv < (uu + 1); vv++) {
+ if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
+ fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
} /* write value != read value */
}
@@ -1285,6 +1284,8 @@ static int testfl_VLof_comptype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (cmptype > 0) H5Tclose(cmptype);
+ if (vltype > 0) H5Tclose(vltype);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -1305,48 +1306,46 @@ static int testfl_compound_VL_VLtype(void)
{
/* Struct that the VL sequences are composed of */
typedef struct {
- int i;
+ unsigned u;
float f;
hvl_t v;
} compVLVL_t;
hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t space=H5I_INVALID_HID; /* Dataspace identifier */
hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
a VL of VL of atomic datatype */
- hsize_t dims1[] = {NRECORDS};
hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
char msg[80]; /* For error message */
herr_t ret; /* Returned status from a callee */
TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii<NRECORDS; ii++) {
- writeBuf[ii].i = ii*10;
- writeBuf[ii].f = (float)((ii*20)/3.0F);
- writeBuf[ii].v.p = HDmalloc((ii+L1_INCM)*sizeof(hvl_t));
- if (writeBuf[ii].v.p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].u = uu * 10;
+ writeBuf[uu].f = (float)(uu * 20) / 3.0F;
+ writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ if (writeBuf[uu].v.p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- writeBuf[ii].v.len=ii+L1_INCM;
- for (t1=(hvl_t *)((writeBuf[ii].v).p), jj=0; jj<(ii+L1_INCM); jj++, t1++)
+ writeBuf[uu].v.len = uu + L1_INCM;
+ for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
{
- t1->p = HDmalloc((jj+L2_INCM)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%d\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+L2_INCM;
- for (kk=0; kk<jj+L2_INCM; kk++)
- ((unsigned int*)t1->p)[kk] = ii*100 + jj*10 + kk;
+ t1->len = vv + L2_INCM;
+ for (ww = 0; ww < vv + L2_INCM; ww++)
+ ((unsigned int*)t1->p)[ww] = uu * 100 + vv * 10 + ww;
}
} /* end for */
@@ -1355,11 +1354,6 @@ static int testfl_compound_VL_VLtype(void)
if (fid < 0)
goto error;
- /* Create dataspace for datasets */
- space = H5Screate_simple(SPACE3_RANK, dims1, NULL);
- if (space < 0)
- goto error;
-
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
@@ -1376,7 +1370,7 @@ static int testfl_compound_VL_VLtype(void)
goto error;
/* Insert fields: atomic, atomic, vlen */
- ret = H5Tinsert(comp_vlvl, "i", HOFFSET(compVLVL_t, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
@@ -1393,7 +1387,11 @@ static int testfl_compound_VL_VLtype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release datatypes */
+ if (H5Tclose(vlatomic) < 0)
+ goto error;
+ if (H5Tclose(vlofvl) < 0)
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
goto error;
@@ -1416,29 +1414,29 @@ static int testfl_compound_VL_VLtype(void)
goto error;
/* Compare data read in */
- for (ii = 0; ii < NRECORDS; ii++) {
- if (writeBuf[ii].i != readBuf[ii].i) {
- fprintf(stderr, "Integer components don't match!, writeBuf[%d].i=%d, readBuf[%d].i=%d\n",(int)ii,(int)writeBuf[ii].i,(int)ii,(int)readBuf[ii].i);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ if (writeBuf[uu].u != readBuf[uu].u) {
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
- if (!H5_FLT_ABS_EQUAL(writeBuf[ii].f,readBuf[ii].f)) {
- fprintf(stderr, "Float components don't match!, writeBuf[%d].f=%f, readBuf[%d].f=%f\n",(int)ii,(double)writeBuf[ii].f,(int)ii,(double)readBuf[ii].f);
+ if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
- if (writeBuf[ii].v.len != readBuf[ii].v.len) {
- fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%d, readBuf[%d].v.len=%d\n",__LINE__,(int)ii,(int)writeBuf[ii].v.len,(int)ii,(int)readBuf[ii].v.len);
+ if (writeBuf[uu].v.len != readBuf[uu].v.len) {
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
- for (t1=(hvl_t *)(writeBuf[ii].v.p), t2=(hvl_t *)(readBuf[ii].v.p), jj=0; (size_t)jj<readBuf[ii].v.len; jj++, t1++, t2++) {
+ for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- fprintf(stderr, "%d: VL data length don't match!, ii=%d, jj=%d, t1->len=%d, t2->len=%d\n",__LINE__,(int)ii,(int)jj,(int)t1->len,(int)t2->len);
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
- for (kk=0; (size_t)kk<t2->len; kk++) {
- if (((unsigned int *)t1->p)[kk] != ((unsigned int *)t2->p)[kk] ) {
- fprintf(stderr, "VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)kk, (int)((unsigned int *)t1->p)[kk], (int)kk, (int)((unsigned int *)t2->p)[kk]);
+ for (ww = 0; (size_t)ww < t2->len; ww++) {
+ if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@@ -1458,12 +1456,6 @@ static int testfl_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- /* Release datatypes */
- if (H5Tclose(vlatomic) < 0)
- goto error;
- if (H5Tclose(vlofvl) < 0)
- goto error;
-
/* Close the file */
if (H5Fclose(fid) < 0)
goto error;
@@ -1472,6 +1464,9 @@ static int testfl_compound_VL_VLtype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vlatomic > 0) H5Tclose(vlatomic);
+ if (vlofvl > 0) H5Tclose(vlofvl);
+ if (comp_vlvl > 0) H5Tclose(comp_vlvl);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -1496,7 +1491,7 @@ static int testfl_VLof_VLtype(void)
hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
hsize_t count; /* Number of records in the table */
hvl_t *t1; /* pointer to advance */
- int ii, jj, kk; /* Loop variables */
+ unsigned uu, vv, ww; /* Loop variables */
hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
char msg[80]; /* For error message */
@@ -1505,23 +1500,23 @@ static int testfl_VLof_VLtype(void)
TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
- for (ii=0; ii< NRECORDS; ii++) {
- writeBuf[ii].p = HDmalloc((ii+1)*sizeof(hvl_t));
- if (writeBuf[ii].p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ for (uu = 0; uu < NRECORDS; uu++) {
+ writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ if (writeBuf[uu].p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
- writeBuf[ii].len = ii+1;
- for (t1=(hvl_t *)(writeBuf[ii].p), jj=0; jj<(ii+1); jj++, t1++)
+ writeBuf[uu].len = uu + 1;
+ for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
{
- t1->p = HDmalloc((jj+1)*sizeof(unsigned int));
+ t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! ii=%u\n",ii);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
- t1->len = jj+1;
- for (kk=0; kk<(jj+1); kk++)
- ((unsigned int *)t1->p)[kk] = ii*100+jj*10+kk;
+ t1->len = vv + 1;
+ for (ww = 0; ww < (vv + 1); ww++)
+ ((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
} /* end for */
} /* end for */
@@ -1546,7 +1541,9 @@ static int testfl_VLof_VLtype(void)
if (ptable == H5I_INVALID_HID)
goto error;
- /* Close the vlen datatype */
+ /* Release datatypes */
+ if (H5Tclose(vlatomic) < 0)
+ goto error;
if (H5Tclose(vlofvl) < 0)
goto error;
@@ -1589,6 +1586,8 @@ static int testfl_VLof_VLtype(void)
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
+ if (vlatomic > 0) H5Tclose(vlatomic);
+ if (vlofvl > 0) H5Tclose(vlofvl);
if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
if (fid > 0) H5Fclose(fid);
H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
@@ -1652,7 +1651,6 @@ int test_packet_table_with_varlen(void)
if (test_accessors() < 0)
status = FAIL;
-
/**************************************************************************
Calling test functions for deprecated function H5PTcreate_fl
Mar 2016, -BMR