summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-05-04 15:49:01 (GMT)
committerGitHub <noreply@github.com>2022-05-04 15:49:01 (GMT)
commit838d050a63d310a38f92a510dc94c0656a84bb51 (patch)
tree55fe7b05c0408ebf4b28c3bfb5cd9a1d04fb2502 /hl/test
parent19a59c29b93c04ae069881da2354d3d7048619b9 (diff)
downloadhdf5-838d050a63d310a38f92a510dc94c0656a84bb51.zip
hdf5-838d050a63d310a38f92a510dc94c0656a84bb51.tar.gz
hdf5-838d050a63d310a38f92a510dc94c0656a84bb51.tar.bz2
h5test.h testing macros get enclosed in do..while loops (#1721)
* h5test.h testing macros get enclosed in do..while loops * Adds missed macro in hl C++ code * Fixes macro in Windows code
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/h5hltest.h10
-rw-r--r--hl/test/test_h5do_compat.c20
-rw-r--r--hl/test/test_ld.c282
3 files changed, 156 insertions, 156 deletions
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index 14f3e14..58b15be 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -29,21 +29,21 @@
/* Macros used in HL tests */
#define HL_TESTING2(WHAT) \
- { \
+ do { \
HDprintf("Testing %-62s", WHAT); \
HDfflush(stdout); \
- }
+ } while (0)
#define HL_TESTING3(WHAT) \
- { \
+ do { \
HDprintf("Testing %-62s", WHAT); \
HDfflush(stdout); \
- }
+ } while (0)
/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) \
do { \
if (!(condition)) \
- FAIL_PUTS_ERROR(string) \
+ FAIL_PUTS_ERROR(string); \
} while (0)
int test_packet_table_with_varlen(void);
diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c
index 6f19d4b..95ae98c 100644
--- a/hl/test/test_h5do_compat.c
+++ b/hl/test/test_h5do_compat.c
@@ -125,7 +125,7 @@ test_direct_chunk_write(hid_t did)
offset[0] = 0;
for (i = 0; i < NX / CHUNK_NX; i++) {
if (H5DOwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, data_size, chunk_data) < 0)
- TEST_ERROR
+ TEST_ERROR;
offset[0] += CHUNK_NX;
}
@@ -171,9 +171,9 @@ test_direct_chunk_read(hid_t did)
/* Create dataspaces for reading */
if ((mem_sid = H5Screate_simple(1, chunk_dims, NULL)) < 0)
- TEST_ERROR
+ TEST_ERROR;
if ((file_sid = H5Screate_simple(1, dims, NULL)) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* For each chunk in the dataset, compare the result of H5Dread and H5DOread_chunk. */
for (i = 0; i < NX / CHUNK_NX; i++) {
@@ -186,34 +186,34 @@ test_direct_chunk_read(hid_t did)
/* Hyperslab selection equals single chunk */
if (H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, stride, count, block) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Read the chunk back */
if (H5Dread(did, H5T_NATIVE_INT, mem_sid, file_sid, H5P_DEFAULT, check) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Read the raw chunk back */
HDmemset(chunk_data, 0, CHUNK_NX * sizeof(int));
filter_mask = UINT_MAX;
offset[0] = (hsize_t)i * CHUNK_NX;
if (H5DOread_chunk(did, H5P_DEFAULT, offset, &filter_mask, chunk_data) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check filter mask return value */
if (filter_mask != 0)
- TEST_ERROR
+ TEST_ERROR;
/* Check that the values are correct */
for (j = 0; j < CHUNK_NX; j++)
if (chunk_data[i] != check[i])
- TEST_ERROR
+ TEST_ERROR;
}
/* Close */
if (H5Sclose(mem_sid) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (H5Sclose(file_sid) < 0)
- TEST_ERROR
+ TEST_ERROR;
PASSED();
return 0;
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 150d04c..4b01f49 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -69,7 +69,7 @@ int two_tests[TWO_NTESTS][2] = {{2, 2}, {2, -1}, {2, 0}, {-1, 2}, {-1, -1}, {-1,
{ \
long __x = (long)_x, __y = (long)_y; \
if (__x != __y) \
- TEST_ERROR \
+ TEST_ERROR; \
}
/* Temporary buffer for reading in the test file */
@@ -247,7 +247,7 @@ test_LD_dims_params(const char *file)
/* Open the copied file */
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* 1. Verify failure with negative dataset id
@@ -263,7 +263,7 @@ test_LD_dims_params(const char *file)
* 2. Verify failure for NULL cur_dims
*/
if ((did = H5Dopen2(fid, DSET_ALLOC_EARLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
H5E_BEGIN_TRY
{
ret = H5LDget_dset_dims(did, NULL);
@@ -271,30 +271,30 @@ test_LD_dims_params(const char *file)
H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* 3. Verify for nonNULL cur_dims
*/
if ((did = H5Dopen2(fid, DSET_ALLOC_LATE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
VERIFY_EQUAL(one_cur_dims[0], 10)
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* 4. Verify nonNULL cur_dims for a 2-dimensional dataset
*/
if ((did = H5Dopen2(fid, DSET_CMPD_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5LDget_dset_dims(did, two_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
VERIFY_EQUAL(two_cur_dims[0], TWO_DIM_1)
VERIFY_EQUAL(two_cur_dims[1], TWO_DIM_2)
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* 5. Verify nonNULL cur_dims for dataset with H5S_NULL dataspace
@@ -302,13 +302,13 @@ test_LD_dims_params(const char *file)
one_cur_dims[0] = 0;
if ((did = H5Dopen2(fid, DSET_NULL, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
VERIFY_EQUAL(one_cur_dims[0], 0)
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* 6. Verify nonNULL cur_dims for dataset with H5S_SCALAR dataspace
@@ -316,17 +316,17 @@ test_LD_dims_params(const char *file)
one_cur_dims[0] = 0;
if ((did = H5Dopen2(fid, DSET_SCALAR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
VERIFY_EQUAL(one_cur_dims[0], 0)
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the file */
if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
return 0;
@@ -396,21 +396,21 @@ test_LD_dims(const char *file)
/* Make a copy of the test file */
if (h5_make_local_copy(file, COPY_FILENAME) < 0)
- TEST_ERROR
+ TEST_ERROR;
/* Open the copied file */
if ((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Testing with one-dimensional dataset: DSET_ONE
*/
if ((did = H5Dopen2(fid, DSET_ONE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Retrieve dimension sizes */
if (H5LDget_dset_dims(did, one_prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
for (i = 0; i < ONE_NTESTS; i++) {
@@ -419,11 +419,11 @@ test_LD_dims(const char *file)
/* Change the dimension size */
if (H5Dset_extent(did, one_ext_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Retrieve the dimension size */
if (H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify that the retrieved dimension size is correct as expected */
VERIFY_EQUAL(one_cur_dims[0], one_ext_dims[0])
@@ -431,17 +431,17 @@ test_LD_dims(const char *file)
/* Close the dataset */
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Testing with two-dimensional dataset: DSET_TWO
*/
if ((did = H5Dopen2(fid, DSET_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Retrieve the dimension sizes */
if (H5LDget_dset_dims(did, two_prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
for (i = 0; i < TWO_NTESTS; i++) {
@@ -451,11 +451,11 @@ test_LD_dims(const char *file)
/* Change the dimension sizes */
if (H5Dset_extent(did, two_ext_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Retrieve the dimension sizes */
if (H5LDget_dset_dims(did, two_cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify that the retrieved dimension sizes are correct as expected */
VERIFY_EQUAL(two_cur_dims[0], two_ext_dims[0])
@@ -464,11 +464,11 @@ test_LD_dims(const char *file)
/* Close the dataset */
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the file */
if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove the copied file */
HDremove(COPY_FILENAME);
@@ -537,7 +537,7 @@ test_LD_size(const char *file)
/* Open the file */
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Verify failure with an invalid dataset id
@@ -556,90 +556,90 @@ test_LD_size(const char *file)
/* Open dataset DSET_CMPD */
if ((did = H5Dopen2(fid, DSET_CMPD, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Return size of the whole element */
if ((dsize = H5LDget_dset_type_size(did, NULL)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the dataset's datatype and then its datatype size */
if ((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize = H5Tget_size(dtid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #1 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Get datatype id for each member */
if ((memb0_tid = H5Tget_member_type(dtid, 0)) < 0) /* "field1" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb1_tid = H5Tget_member_type(dtid, 1)) < 0) /* "field2" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb2_tid = H5Tget_member_type(dtid, 2)) < 0) /* "field3" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb3_tid = H5Tget_member_type(dtid, 3)) < 0) /* "field4" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Obtain size for VALID_FIELDS1: "field1,field2.a,field3,field4" */
if ((dsize = H5LDget_dset_type_size(did, VALID_FIELDS1)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the datatype size for "field1" */
if ((ck_dsize = H5Tget_size(memb0_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field2.a" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field3" */
if ((ck_dsize += H5Tget_size(memb2_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field4" */
if ((ck_dsize += H5Tget_size(memb3_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #2 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Obtain datatype size for VALID_FIELDS2: "field2.b.a,field2.c,field4.b" */
if ((dsize = H5LDget_dset_type_size(did, VALID_FIELDS2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the datatype size for "field2.b.a" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb_tid2 = H5Tget_member_type(memb_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize = H5Tget_size(memb_tid2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field2.c" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field4.b" */
if ((memb_tid = H5Tget_member_type(memb3_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #3 */
VERIFY_EQUAL(dsize, ck_dsize)
@@ -664,17 +664,17 @@ test_LD_size(const char *file)
/* Closing */
if (H5Tclose(memb0_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb1_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb2_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb3_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Testing one-dimensional dataset with compound datatype and
@@ -684,54 +684,54 @@ test_LD_size(const char *file)
/* Open dataset DSET_CMPD_ESC */
if ((did = H5Dopen2(fid, DSET_CMPD_ESC, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Return size of the whole element */
if ((dsize = H5LDget_dset_type_size(did, NULL)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the dataset's datatype and then its datatype size */
if ((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize = H5Tget_size(dtid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #1 */
VERIFY_EQUAL(dsize, ck_dsize)
/* Get datatype id for each member */
if ((memb0_tid = H5Tget_member_type(dtid, 0)) < 0) /* "field,1" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb1_tid = H5Tget_member_type(dtid, 1)) < 0) /* "field2." */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb2_tid = H5Tget_member_type(dtid, 2)) < 0) /* "field\3" */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb3_tid = H5Tget_member_type(dtid, 3)) < 0) /* "field4," */
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Obtain size for VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\," */
if ((dsize = H5LDget_dset_type_size(did, VALID_ESC_FIELDS1)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the datatype size for "field\\,1" */
if ((ck_dsize = H5Tget_size(memb0_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field2\\..\\.a" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field\\\\3" */
if ((ck_dsize += H5Tget_size(memb2_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field4\\," */
if ((ck_dsize += H5Tget_size(memb3_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #2 */
VERIFY_EQUAL(dsize, ck_dsize)
@@ -739,35 +739,35 @@ test_LD_size(const char *file)
/* Obtain datatype size for VALID_ESC_FIELDS2:
"field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\," */
if ((dsize = H5LDget_dset_type_size(did, VALID_ESC_FIELDS2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the datatype size for "field2\..,b.a" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((memb_tid2 = H5Tget_member_type(memb_tid, 0)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize = H5Tget_size(memb_tid2)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field2\..\\c" */
if ((memb_tid = H5Tget_member_type(memb1_tid, 2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Add the datatype size for "field4\,.b\," */
if ((memb_tid = H5Tget_member_type(memb3_tid, 1)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if ((ck_dsize += H5Tget_size(memb_tid)) == 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify case #3 */
VERIFY_EQUAL(dsize, ck_dsize)
@@ -792,20 +792,20 @@ test_LD_size(const char *file)
/* Closing */
if (H5Tclose(memb0_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb1_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb2_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(memb3_tid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Tclose(dtid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
return 0;
@@ -868,7 +868,7 @@ test_LD_elmts_invalid(const char *file)
/* Open the copied file */
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Testing two-dimensional dataset: DSET_TWO
@@ -876,7 +876,7 @@ test_LD_elmts_invalid(const char *file)
/* Open dataset: DSET_TWO */
if ((did = H5Dopen2(fid, DSET_TWO, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Verify failure from case #1: cur_dims and prev_dims are NULL */
ret = H5LDget_dset_elmts(did, NULL, NULL, NULL, NULL);
@@ -891,11 +891,11 @@ test_LD_elmts_invalid(const char *file)
VERIFY_EQUAL(ret, FAIL)
if ((sid = H5Dget_space(did)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the # of dimensions and current dimension sizes */
if ((ndims = H5Sget_simple_extent_dims(sid, cur_dims, NULL)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Set up valid cur_dims and prev_dims */
for (i = 0; i < ndims; i++)
@@ -917,7 +917,7 @@ test_LD_elmts_invalid(const char *file)
/* Close DSET_TWO */
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/*
* Testing one-dimensional dataset with compound datatype:
@@ -934,11 +934,11 @@ test_LD_elmts_invalid(const char *file)
/* Open dataset: DSET_CMPD */
if ((did = H5Dopen2(fid, DSET_CMPD, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Retrieve the current dimension sizes */
if (H5LDget_dset_dims(did, cur_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Set up valid cur_dims, prev_dims */
prev_dims[0] = cur_dims[0] - 1;
@@ -949,11 +949,11 @@ test_LD_elmts_invalid(const char *file)
/* Close DSET_CMPD */
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Close the file */
if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
PASSED();
return 0;
@@ -1004,7 +1004,7 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Copy the test file */
if (h5_make_local_copy(file, COPY_FILENAME) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (i = 0; i < TEST_BUF_SIZE; i++) {
cbuf[i].field1 = i;
@@ -1021,19 +1021,19 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Open the copied file */
if ((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Open the dataset */
if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the dataset's data type */
if ((dtype = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get current dimension sizes before extending the dataset's dimension sizes */
if (H5LDget_dset_dims(did, prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Loop through different variations of extending the dataset */
for (i = 0; i < ONE_NTESTS; i++) {
@@ -1046,16 +1046,16 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Change the dimension sizes of the dataset */
if (H5Dset_extent(did, ext_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Initialize data */
if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end if */
else if (!HDstrcmp(dname, DSET_ONE)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end if */
/* There are changes in dimension sizes */
@@ -1065,24 +1065,24 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (j = 0; j < one_tests[i]; j++)
VERIFY_ELMTS_VALID1(vbuf1[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end if */
else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (j = 0; j < one_tests[i]; j++)
VERIFY_ELMTS_VALID2(vbuf2[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end else-if */
else
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
else {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (j = 0; j < one_tests[i]; j++)
VERIFY_ELMTS_ALL(ccbuf[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end else-if */
@@ -1090,7 +1090,7 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
else {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (j = 0; j < one_tests[i]; j++)
VERIFY_EQUAL(iibuf[j], ibuf[prev_dims[0] + (hsize_t)j])
} /* end else */
@@ -1104,11 +1104,11 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Closing */
if (H5Tclose(dtype) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Remove the copied file */
HDremove(COPY_FILENAME);
@@ -1215,7 +1215,7 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* Copy the test file */
if (h5_make_local_copy(file, COPY_FILENAME) < 0)
- TEST_ERROR
+ TEST_ERROR;
for (i = 0; i < TEST_BUF_SIZE; i++) {
cbuf[i].field1 = i;
@@ -1232,19 +1232,19 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* Open the copied file */
if ((fid = H5Fopen(COPY_FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Open the dataset */
if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get the dataset's data type */
if ((dtype = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Get current dimension sizes before extending the dataset's dimension sizes */
if (H5LDget_dset_dims(did, prev_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Loop through different variations of extending the dataset */
for (i = 0; i < TWO_NTESTS; i++) {
@@ -1258,19 +1258,19 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* Change the dimension sizes of the dataset */
if (H5Dset_extent(did, ext_dims) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
/* Initialize data */
if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end if */
else if (!HDstrcmp(dname, DSET_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR;
} /* end else-if */
else
- TEST_ERROR
+ TEST_ERROR;
/* There are changes in dimension sizes */
if (two_tests[i][0] > 0 || two_tests[i][1] > 0) {
@@ -1279,34 +1279,34 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (verify_elmts_two(TWO_CMPD_VALID1, ext_dims, prev_dims, vbuf1, cbuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (verify_elmts_two(TWO_CMPD_VALID2, ext_dims, prev_dims, vbuf2, cbuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
} /* end else-if */
else
- TEST_ERROR
+ TEST_ERROR;
} /* end if */
else {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (verify_elmts_two(TWO_CMPD_NULL, ext_dims, prev_dims, ccbuf, cbuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
} /* end else */
} /* end if */
else { /* DSET_TWO */
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
if (verify_elmts_two(TWO_NONE, ext_dims, prev_dims, iibuf, ibuf) < 0)
- TEST_ERROR
+ TEST_ERROR;
} /* end else */
} /* end if */
else {