summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-18 20:36:57 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-18 20:36:57 (GMT)
commit16093cc00241824a3f595392aaa5aeab53d93b59 (patch)
tree421e39191c5e6d1b4ca1fbbe97e37c597b985335 /hl
parent3413544b00a5a0c349e8f29dc98562bef287ef9c (diff)
downloadhdf5-16093cc00241824a3f595392aaa5aeab53d93b59.zip
hdf5-16093cc00241824a3f595392aaa5aeab53d93b59.tar.gz
hdf5-16093cc00241824a3f595392aaa5aeab53d93b59.tar.bz2
Merge HD prefix and whitespace changes from develop
Diffstat (limited to 'hl')
-rw-r--r--hl/c++/test/ptableTest.cpp126
-rw-r--r--hl/c++/test/ptableTest.h2
-rw-r--r--hl/test/gen_test_ds.c10
-rw-r--r--hl/test/h5hltest.h4
-rw-r--r--hl/test/test_ds.c94
-rw-r--r--hl/test/test_dset_append.c104
-rw-r--r--hl/test/test_file_image.c82
-rw-r--r--hl/test/test_h5do_compat.c50
-rw-r--r--hl/test/test_image.c28
-rw-r--r--hl/test/test_ld.c1134
-rw-r--r--hl/test/test_lite.c90
-rw-r--r--hl/test/test_packet.c30
-rw-r--r--hl/test/test_packet_vlen.c750
-rw-r--r--hl/test/test_table.c146
14 files changed, 1328 insertions, 1322 deletions
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp
index 340912e..e873503 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -36,22 +36,22 @@ int main(void)
}
else {
- num_errors += BasicTest();
+ num_errors += BasicTest();
- num_errors += TestCompoundDatatype();
+ num_errors += TestCompoundDatatype();
- num_errors += TestGetPacket();
+ num_errors += TestGetPacket();
- num_errors += TestGetNext();
+ num_errors += TestGetNext();
- num_errors += TestCompress();
+ num_errors += TestCompress();
- num_errors += TestErrors();
+ num_errors += TestErrors();
- num_errors += SystemTest();
+ num_errors += SystemTest();
- /* Test data corruption in packed structs */
- num_errors += TestHDFFV_9758();
+ /* Test data corruption in packed structs */
+ num_errors += TestHDFFV_9758();
/* Terminate access to the file. */
err = H5Fclose(fileID);
@@ -81,7 +81,8 @@ int BasicTest()
hsize_t count;
int error;
- TESTING("basic functionality")
+ printf("Testing %-62s", "basic functionality");
+ HDfflush(stdout);
FL_PacketTable wrapper(fileID, H5P_DEFAULT, BASICTEST_PT, H5T_NATIVE_INT, 1);
if(! wrapper.IsValid())
@@ -137,7 +138,8 @@ int TestCompoundDatatype()
hsize_t count;
int error;
- TESTING("compound datatypes")
+ printf("Testing %-62s", "compound datatypes");
+ HDfflush(stdout);
/* Create compound datatype */
typedef struct compoundType
@@ -206,7 +208,8 @@ int TestGetNext()
int records[2];
int i;
- TESTING("GetNextPacket")
+ printf("Testing %-62s", "GetNextPacket");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, H5P_DEFAULT, GETNEXT_PT, H5T_NATIVE_INT, 500);
@@ -268,20 +271,21 @@ int TestCompress()
unsigned int config = 0;
size_t cd_nelemts = 0;
- TESTING("compression")
+ printf("Testing %-62s", "compression");
+ HDfflush(stdout);
#ifdef H5_HAVE_FILTER_DEFLATE
try {
- /* Prepare property list to set compression, randomly use deflate */
- DSetCreatPropList dscreatplist;
- dscreatplist.setDeflate(6);
+ /* Prepare property list to set compression, randomly use deflate */
+ DSetCreatPropList dscreatplist;
+ dscreatplist.setDeflate(6);
/* Create packet table with compression. */
FL_PacketTable wrapper(fileID, COMPRESS_PT, H5T_NATIVE_CHAR, 100, dscreatplist.getId());
- /* Close the property list */
- dscreatplist.close();
+ /* Close the property list */
+ dscreatplist.close();
- /* Verify that the deflate filter is set */
+ /* Verify that the deflate filter is set */
/* Create an HDF5 C++ file object */
H5File file;
@@ -293,10 +297,10 @@ int TestCompress()
DSetCreatPropList dcpl = dset.getCreatePlist();
- char filter_name[8];
+ char filter_name[8];
dcpl.getFilterById(H5Z_FILTER_DEFLATE, flags, cd_nelemts, NULL, 8, filter_name, config);
- if (HDstrncmp(filter_name, "deflate", 7) != 0)
- H5_FAILED()
+ if (HDstrncmp(filter_name, "deflate", 7) != 0)
+ H5_FAILED()
} catch (Exception e) {
H5_FAILED();
return 1;
@@ -304,7 +308,7 @@ int TestCompress()
PASSED();
#else
SKIPPED();
- puts(" deflate filter not enabled");
+ HDputs(" deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
return 0;
}
@@ -315,7 +319,8 @@ int TestGetPacket()
int record;
int theRecs[3];
int i;
- TESTING("GetPacket")
+ printf("Testing %-62s", "GetPacket");
+ HDfflush(stdout);
/* Create a dataset. Does not need to specify property list because
there is no compression. */
@@ -353,7 +358,8 @@ const char* PT_TESTERROR = "/TestErrors";
int TestErrors()
{
- TESTING("error conditions")
+ printf("Testing %-62s", "error conditions");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, PT_TESTERROR, H5T_NATIVE_INT, 1);
@@ -464,7 +470,8 @@ const char* PT_SYSTEMTST1 = "/SystemTest1";
const char* PT_SYSTEMTST2 = "/SystemTest2";
int SystemTest()
{
- TESTING("multiple datatypes")
+ printf("Testing %-62s", "multiple datatypes");
+ HDfflush(stdout);
hid_t dtypeID1, dtypeID2;
hsize_t count;
@@ -560,16 +567,16 @@ error:
/*-------------------------------------------------------------------------
* TestHDFFV_9758(): Test that a packet table with compound datatype which
- * contains string type can be created and written correctly. (HDFFV-9758)
+ * contains string type can be created and written correctly. (HDFFV-9758)
*
* Notes:
- * Previously, data of the field that follows the string was read back
- * as garbage when #pragma pack(1) is used.
+ * Previously, data of the field that follows the string was read back
+ * as garbage when #pragma pack(1) is used.
* 2016/10/20 -BMR
* Updated:
- * #pragma pack(1) caused failure on Emu because Sparc cannot
- * access misaligned data. Changed it to pack() to do the
- * default alignment.
+ * #pragma pack(1) caused failure on Emu because Sparc cannot
+ * access misaligned data. Changed it to pack() to do the
+ * default alignment.
* 2016/10/25 -BMR
*-------------------------------------------------------------------------
*/
@@ -592,57 +599,58 @@ int TestHDFFV_9758()
};
s1_t s1[NUM_PACKETS];
-
+
for (hsize_t i = 0; i < NUM_PACKETS; i++)
{
s1[i].a = i;
s1[i].b = 1.f * static_cast<float>(i * i);
s1[i].c = 1. / (i + 1);
- sprintf(s1[i].d, "string%d", (int)i);
+ HDsprintf(s1[i].d, "string%d", (int)i);
s1[i].e = 100+i;
}
- TESTING("data corruption in packed structs (HDFFV-9758)")
+ printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)");
+ HDfflush(stdout);
// Build a compound datatype
compound_type = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
if (compound_type < 0)
- goto error;
-
+ goto error;
+
err = H5Tinsert(compound_type, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
if (err < 0)
- goto error;
+ goto error;
strtype = H5Tcopy (H5T_C_S1);
if (compound_type < 0)
- goto error;
+ goto error;
err = H5Tset_size (strtype, STRING_LENGTH); /* create string */
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "d_name", HOFFSET(s1_t, d), strtype);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "e_name", HOFFSET(s1_t, e), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
{ // so ptable will go out of scope before PASSED
// Create a packet table
FL_PacketTable ptable(fileID, "/examplePacketTable", compound_type, 1);
if (!ptable.IsValid())
- goto error;
+ goto error;
// Add packets to the table
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- /* Appends one packet at the current position */
+ /* Appends one packet at the current position */
err = ptable.AppendPacket(s1 + i);
if (err < 0) goto error;
}
@@ -650,11 +658,11 @@ int TestHDFFV_9758()
// Check packet count
const hsize_t count = ptable.GetPacketCount(err);
if (err < 0)
- goto error;
-
+ goto error;
+
if (count != NUM_PACKETS)
{
- std::cerr
+ std::cerr
<< "Number of packets in packet table should be " << NUM_PACKETS
<< " but is " << count << endl;
}
@@ -663,16 +671,16 @@ int TestHDFFV_9758()
ptable.ResetIndex();
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- s1_t s2;
- memset(&s2, 0, sizeof(s1_t));
- err = ptable.GetNextPacket(&s2);
- if (err < 0)
- goto error;
-
- if (s2.a != s1[i].a || s2.e != s1[i].e)
- goto error;
- else if (HDstrcmp(s2.d, s1[i].d))
- goto error;
+ s1_t s2;
+ HDmemset(&s2, 0, sizeof(s1_t));
+ err = ptable.GetNextPacket(&s2);
+ if (err < 0)
+ goto error;
+
+ if (s2.a != s1[i].a || s2.e != s1[i].e)
+ goto error;
+ else if (HDstrcmp(s2.d, s1[i].d))
+ goto error;
}
} // end of ptable block
diff --git a/hl/c++/test/ptableTest.h b/hl/c++/test/ptableTest.h
index 8af7bff..e1ba950 100644
--- a/hl/c++/test/ptableTest.h
+++ b/hl/c++/test/ptableTest.h
@@ -21,9 +21,9 @@
#ifndef PTABLETEST
#define PTABLETEST
+#include "h5hltest.h"
#include "H5PacketTable.h"
#include "H5Cpp.h"
-#include "h5hltest.h"
static hid_t fileID;
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index f8f1d39..273e393 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -281,7 +281,7 @@ static int test_long_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -342,7 +342,7 @@ static int test_duplicatelong_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -406,7 +406,7 @@ static int test_long_scalenames(const char *filename) {
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -483,7 +483,7 @@ static int test_samelong_scalenames(const char *filename) {
if((fid = open_test_file(filename)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -554,7 +554,7 @@ static int test_foreign_scaleattached(const char *filename)
hid_t did = -1;
hid_t dsid = -1;
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index f368b8e..85f47bd 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -28,8 +28,8 @@
#include "H5HLprivate2.h"
/* Macros used in HL tests */
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-#define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);}
+#define HL_TESTING2(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
+#define HL_TESTING3(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0)
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 6c75423..9389a0d 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1146,7 +1146,7 @@ static int test_detachscales(void)
and detach them to check that at the end there is no attributes
REFERENCE_LIST on a dimension scale and DIMENSION_LIST on a dataset */
- TESTING2("test_detachscales");
+ HL_TESTING2("test_detachscales");
if((fid = H5Fcreate("test_detach.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -1280,7 +1280,7 @@ static int test_char_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
- TESTING2("test_char_attachscales");
+ HL_TESTING2("test_char_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1333,7 +1333,7 @@ static int test_short_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
- TESTING2("test_short_attachscales");
+ HL_TESTING2("test_short_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1410,7 +1410,7 @@ static int test_int_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_int_attachscales");
+ HL_TESTING2("test_int_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1471,7 +1471,7 @@ static int test_long_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1528,7 +1528,7 @@ static int test_duplicatelong_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1585,7 +1585,7 @@ static int test_float_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
- TESTING2("test_float_attachscales");
+ HL_TESTING2("test_float_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1647,7 +1647,7 @@ static int test_numberofscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_numberofscales");
+ HL_TESTING2("test_numberofscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1729,7 +1729,7 @@ static int test_char_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set char scale/cmp scale name");
+ HL_TESTING2("set char scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
@@ -1789,7 +1789,7 @@ static int test_short_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set short scale/cmp scale name");
+ HL_TESTING2("set short scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
@@ -1897,7 +1897,7 @@ static int test_int_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set int scale/cmp scale name");
+ HL_TESTING2("set int scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
@@ -1973,7 +1973,7 @@ static int test_long_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
@@ -2041,7 +2041,7 @@ static int test_samelong_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
@@ -2109,7 +2109,7 @@ static int test_float_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set float scale/cmp scale name");
+ HL_TESTING2("set float scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
@@ -2181,7 +2181,7 @@ static int test_foreign_scaleattached(const char *fileforeign)
hid_t dsid = -1;
const char *filename = H5_get_srcdir_filename(fileforeign);
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
@@ -2426,7 +2426,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scales ");
+ HL_TESTING2("detach scales ");
/*-------------------------------------------------------------------------
@@ -3013,7 +3013,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -3103,7 +3103,7 @@ static int test_simple(void)
*/
- TESTING2("set scale/get scale name");
+ HL_TESTING2("set scale/get scale name");
if((dsid = H5Dopen2(fid,"ds_a_1", H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"Latitude set 0") < 0)
@@ -3205,7 +3205,7 @@ static int test_simple(void)
*/
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -3771,7 +3771,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset to itself");
+ HL_TESTING2("attach a dataset to itself");
if(H5DSattach_scale(did, did, 0) == SUCCEED)
goto out;
@@ -3782,7 +3782,7 @@ static int test_errors(void)
* attempt to attach a group with a dataset, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a group with a dataset");
+ HL_TESTING2("attach a group with a dataset");
if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
goto out;
@@ -3793,7 +3793,7 @@ static int test_errors(void)
* attempt to attach a dataset with a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset with a group");
+ HL_TESTING2("attach a dataset with a group");
if(H5DSattach_scale(did,gid,0)==SUCCEED)
goto out;
@@ -3804,7 +3804,7 @@ static int test_errors(void)
* attempt to set scale for a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("set scale for a group");
+ HL_TESTING2("set scale for a group");
if(H5DSset_scale(gid,"scale 1")==SUCCEED)
goto out;
@@ -3834,7 +3834,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scale that has scales");
+ HL_TESTING2("attach a scale that has scales");
/* create the data space for the scale */
if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
@@ -3903,7 +3903,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a scale");
+ HL_TESTING2("attach to a dataset that is a scale");
/* open the previous written "ds_b", that is a scale */
if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
@@ -3930,7 +3930,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a reserved class dataset");
+ HL_TESTING2("attach to a dataset that is a reserved class dataset");
/* make an image */
if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
@@ -3965,7 +3965,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("is scale");
+ HL_TESTING2("is scale");
/* open a non scale dataset */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -3999,7 +3999,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from dataset it is not attached to");
+ HL_TESTING2("detach scale from dataset it is not attached to");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4027,7 +4027,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from group");
+ HL_TESTING2("detach scale from group");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4055,7 +4055,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale when scale is group");
+ HL_TESTING2("detach scale when scale is group");
/* open the previous written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4147,7 +4147,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate when the dataset has no scales ");
+ HL_TESTING2("iterate when the dataset has no scales ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4169,7 +4169,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on dimension that is outside the rank ");
+ HL_TESTING2("iterate on dimension that is outside the rank ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4190,7 +4190,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate for dimension with many scales ");
+ HL_TESTING2("iterate for dimension with many scales ");
/* open the previously written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4227,7 +4227,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on group ");
+ HL_TESTING2("iterate on group ");
/* open */
if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
@@ -4249,7 +4249,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate in deleted scales ");
+ HL_TESTING2("iterate in deleted scales ");
if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
goto out;
@@ -4343,7 +4343,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach");
+ HL_TESTING2("attach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4371,7 +4371,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach");
+ HL_TESTING2("detach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4397,7 +4397,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach, set, get names, labels");
+ HL_TESTING2("attach, set, get names, labels");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4436,7 +4436,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scalar scale");
+ HL_TESTING2("attach a scalar scale");
/* create the data space for the dataset */
if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
@@ -4549,7 +4549,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("floating point and short scales");
+ HL_TESTING2("floating point and short scales");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4612,7 +4612,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("string scales");
+ HL_TESTING2("string scales");
/* get the dataset id for "dset_b" */
if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
@@ -4709,7 +4709,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("generating scales");
+ HL_TESTING2("generating scales");
/*-------------------------------------------------------------------------
* create datasets: 1 "data" dataset and 2 dimension scales
@@ -4954,7 +4954,7 @@ static int test_errors2(void)
goto out;
- TESTING2("attach scales");
+ HL_TESTING2("attach scales");
/*-------------------------------------------------------------------------
@@ -4977,7 +4977,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("detach scales");
+ HL_TESTING2("detach scales");
/*-------------------------------------------------------------------------
* detach with invalid indices
@@ -4998,7 +4998,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
/*-------------------------------------------------------------------------
* set/get label invalid indices
@@ -5023,7 +5023,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -5122,7 +5122,7 @@ static int test_attach_detach(void)
hid_t var1_id, var2_id, var3_id; /* DS component name */
hsize_t dims[RANK1] = {DIM1};
- TESTING2("permutations of attaching and detaching");
+ HL_TESTING2("permutations of attaching and detaching");
if((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c
index 8bb4f84..1914a08 100644
--- a/hl/test/test_dset_append.c
+++ b/hl/test/test_dset_append.c
@@ -18,7 +18,7 @@
#include "h5hltest.h"
#include "H5DOpublic.h"
-#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER)
+#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER)
# define H5_ZLIB_HEADER "zlib.h"
#endif
#if defined(H5_ZLIB_HEADER)
@@ -64,22 +64,22 @@ test_dataset_append_notset(hid_t fid)
int i, j; /* Local index variables */
h5_stat_t sb1, sb2; /* File info */
- TESTING("Append flush with H5DOappend()--append rows with default dapl");
+ HL_TESTING2("Append flush with H5DOappend()--append rows with default dapl");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_NOTSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
/* Append 6 rows to the dataset */
@@ -104,7 +104,7 @@ test_dataset_append_notset(hid_t fid)
TEST_ERROR;
/* File size before flushing should be less */
- if(sb1.st_size > sb2.st_size)
+ if(sb1.st_size > sb2.st_size)
TEST_ERROR;
/* Closing */
@@ -183,28 +183,28 @@ test_dataset_append_rows_columns(hid_t fid)
int i, j; /* Local index variables */
- TESTING("Append flush with H5DOappend()--append rows & columns");
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_UNLIM, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@@ -246,7 +246,7 @@ test_dataset_append_rows_columns(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@@ -336,28 +336,28 @@ test_dataset_append_rows(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append rows");
+ HL_TESTING2("Append flush with H5DOappend()--append rows");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_ROW, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@@ -380,7 +380,7 @@ test_dataset_append_rows(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 10; j++)
@@ -470,28 +470,28 @@ test_dataset_append_columns(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append columns");
+ HL_TESTING2("Append flush with H5DOappend()--append columns");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 1 extendible dimension */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_COLUMN, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 3 columns to the dataset */
@@ -515,7 +515,7 @@ test_dataset_append_columns(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 3; j++)
@@ -614,28 +614,28 @@ test_dataset_append_BUG1(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append rows & columns--BUG1");
-
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG1");
+
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DBUGNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@@ -677,7 +677,7 @@ test_dataset_append_BUG1(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@@ -775,28 +775,28 @@ test_dataset_append_BUG2(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append rows & columns--BUG2");
-
+ HL_TESTING2("Append flush with H5DOappend()--append rows & columns--BUG2");
+
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DBUGNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset */
@@ -839,7 +839,7 @@ test_dataset_append_BUG2(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@@ -930,28 +930,28 @@ test_dataset_append_less(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append size < boundary size");
+ HL_TESTING2("Append flush with H5DOappend()--append size < boundary size");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_LESS, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append to the dataset 2 rows at a time for 3 times */
@@ -996,7 +996,7 @@ test_dataset_append_less(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@@ -1057,7 +1057,7 @@ error:
*
* Purpose: Verify that the object flush property and the append flush property
* are working properly when appending rows and columns to an
- * extendible dataset where
+ * extendible dataset where
* row: the append size is 3 times of the boundary size
* the append callback/flush is performed on the 1st boundary hit
* column: the boundary is greater than the append size
@@ -1090,28 +1090,28 @@ test_dataset_append_vary(hid_t fid)
unsigned append_ct = 0; /* The # of appends */
unsigned *flush_ptr; /* Points to the flush counter */
- TESTING("Append flush with H5DOappend()--append & boundary size vary");
+ HL_TESTING2("Append flush with H5DOappend()--append & boundary size vary");
/* Get the file's file access property list */
if((ffapl = H5Fget_access_plist(fid)) < 0)
FAIL_STACK_ERROR;
/* Set to create a chunked dataset with 2 extendible dimensions */
- if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
+ if((sid = H5Screate_simple(2, dims, maxdims)) < 0)
FAIL_STACK_ERROR;
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
FAIL_STACK_ERROR;
/* Set append flush property */
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR;
if(H5Pset_append_flush(dapl, 2, boundary, append_func, &append_ct) < 0)
FAIL_STACK_ERROR;
/* Create the dataset */
- if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
+ if((did = H5Dcreate2(fid, DNAME_VARY, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl)) < 0)
TEST_ERROR;
/* Append 6 rows to the dataset, once */
@@ -1151,7 +1151,7 @@ test_dataset_append_vary(hid_t fid)
/* Read the dataset */
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
FAIL_STACK_ERROR;
-
+
/* Verify the data */
for(i = 0; i < 6; i++)
for(j = 0; j < 13; j++)
@@ -1227,7 +1227,7 @@ int main(void)
int nerrors = 0; /* The # of errors encountered */
/* Get a copy of file access property list */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
/* Set to use the latest library format */
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index a98642c..ef220f9 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -44,7 +44,7 @@
extend the image, and then performs writes that extend the images. The fifth
loop reads the extended images and verify that the content are correct. The
sixth and final loop closes the file images and deallocates the image
- buffers if appropriate. */
+ buffers if appropriate. */
/*-------------------------------------------------------------------------
* test file image operations
@@ -67,11 +67,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
void **buf_ptr; /* pointer to array of pointers to image buffers */
char **filename; /* pointer to array of pointers to filenames */
unsigned *input_flags; /* pointer to array of flag combinations */
- size_t i, j, k, nrow, n_values;
+ size_t i, j, k, nrow, n_values;
herr_t status1;
void *handle_ptr = NULL; /* pointers to driver buffer */
- unsigned char **core_buf_ptr_ptr = NULL;
-
+ unsigned char **core_buf_ptr_ptr = NULL;
+
VERIFY(open_images > 1 , "The number of open images must be greater than 1");
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
@@ -100,7 +100,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
- TESTING("get file images");
+ HL_TESTING2("get file images");
/* create several file images */
for (i = 0; i < open_images; i++) {
@@ -118,11 +118,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Fcreate() failed");
- /* define dataspace for the dataset */
- if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
+ /* define dataspace for the dataset */
+ if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
FAIL_PUTS_ERROR("H5Screate_simple() failed");
- /* create dataset property list */
+ /* create dataset property list */
if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_PUTS_ERROR("H5Pcreate() failed");
@@ -133,8 +133,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* create and write an integer type dataset named "dset" */
if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dcreate() failed");
-
- /* dataset in open image 1 is written with "wrong" data */
+
+ /* dataset in open image 1 is written with "wrong" data */
if (i == 1) {
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
@@ -144,7 +144,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
} /* end else */
-
+
/* flush into the file */
if (H5Fflush(file_id[i], H5F_SCOPE_LOCAL) < 0)
FAIL_PUTS_ERROR("H5Fflush() failed");
@@ -152,7 +152,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* close dataset property list */
if (H5Pclose(plist) < 0)
FAIL_PUTS_ERROR("H5Pclose() failed");
-
+
/* close dataspace */
if (H5Sclose(file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -172,7 +172,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* buffer for file image 2 is filled with counter data (non-valid image) */
if (i == 2) {
for (j = 0; j < (size_t)buf_size[i]; j++)
- ((char*)(buf_ptr[i]))[j] = (char)j;
+ ((char*)(buf_ptr[i]))[j] = (char)j;
} /* end if */
/* buffers for the rest of the file images are filled with data from the respective files */
else {
@@ -187,14 +187,14 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("open file images and check image copies");
-
- /* open the file images with the core driver for data access */
+ HL_TESTING2("open file images and check image copies");
+
+ /* open the file images with the core driver for data access */
for (i = 0; i < open_images; i++) {
/* open file image 2 filled with counter data (non-valid image) */
if (i == 2) {
H5E_BEGIN_TRY {
- /* attempt to set file image in the core driver */
+ /* attempt to set file image in the core driver */
file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i]);
} H5E_END_TRY
@@ -202,7 +202,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
} /* end if */
/* open rest of valid file images */
else {
- /* set file image in the core driver */
+ /* set file image in the core driver */
if ((file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i])) < 0)
FAIL_PUTS_ERROR("H5LTopen_file_image() failed");
@@ -218,7 +218,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
else
VERIFY(*core_buf_ptr_ptr != buf_ptr[i], "vfd buffer and user buffer should be different");
- /*
+ /*
* When the vfd and user buffers are different and H5LT_FILE_IMAGE_OPEN_RW is enabled,
* status_flags in the superblock needs to be cleared in the vfd buffer for
* the comparison to proceed as expected. The user buffer as returned from H5Fget_file_image()
@@ -249,7 +249,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read file images");
+ HL_TESTING2("read file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -259,7 +259,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
continue;
} /* end if */
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -274,8 +274,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -297,15 +297,15 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (data3[j * nrow + k ] != data1[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
} /* end else */
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
} /* end for */
- PASSED();
+ PASSED();
- TESTING("write and extend file images");
+ HL_TESTING2("write and extend file images");
/* write open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -365,7 +365,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
hid_t attr_space_id = -1;
hid_t attr_id = -1;
herr_t status2;
- size_t l;
+ size_t l;
if ((attr_space_id = H5Screate_simple(attr_rank, attr_dims, attr_dims)) < 0)
FAIL_PUTS_ERROR("attr_space H5Screate_simple() failed");
@@ -396,9 +396,9 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
H5Aclose(attr_id);
} H5E_END_TRY;
#endif
- if (H5Dclose(dset_id[i]) < 0)
- FAIL_PUTS_ERROR("H5Dclose() failed");
- dset_id[i] = -1;
+ if (H5Dclose(dset_id[i]) < 0)
+ FAIL_PUTS_ERROR("H5Dclose() failed");
+ dset_id[i] = -1;
} /* end if */
else {
/* write dataset without extending it */
@@ -422,7 +422,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read extended file images");
+ HL_TESTING2("read extended file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -430,7 +430,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((dset_id[i] < 0) || (file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
continue;
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -445,8 +445,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -457,8 +457,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
for (k = 0; k < nrow; k++)
if (data3[j * nrow + k ] != data4[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -469,7 +469,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED()
- TESTING("close file images");
+ HL_TESTING2("close file images");
/* close file images and release buffer if appropriate */
for (i = 0; i < open_images; i++) {
@@ -489,7 +489,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
HDfree(buf_ptr[i]);
} /* end if */
-
+
} /* end for */
/* release temporary working buffers */
@@ -521,8 +521,8 @@ int main( void )
size_t open_images = 10; /* number of open file images */
size_t nflags = 8; /* number of flag combinations */
unsigned flags[8]; /* array with flag combinations */
-
- /* set flag combinations for testing */
+
+ /* set flag combinations for testing */
flags[0] = 0;
flags[1] = H5LT_FILE_IMAGE_DONT_RELEASE;
flags[2] = H5LT_FILE_IMAGE_DONT_COPY;
diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c
index 4df5eef..75028fb 100644
--- a/hl/test/test_h5do_compat.c
+++ b/hl/test/test_h5do_compat.c
@@ -26,14 +26,14 @@
#define NX 8
#define CHUNK_NX 4
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_write
+ * Function: test_direct_chunk_write
*
- * Purpose: Test the basic functionality of H5DOwrite_chunk
+ * Purpose: Test the basic functionality of H5DOwrite_chunk
*
- * Return: Success: An identifer for the dataset used in the tests
- * Failure: H5I_INVALID_HID
+ * Return: Success: An identifer for the dataset used in the tests
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -65,7 +65,7 @@ create_dataset(hid_t fid)
/* Initialize the data */
for (i = 0; i < NX; i++)
- data[i] = i;
+ data[i] = i;
/* Write the initialized data */
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
@@ -91,14 +91,14 @@ create_dataset(hid_t fid)
} /* end create_dataset() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_write
+ * Function: test_direct_chunk_write
*
- * Purpose: Test the basic functionality of H5DOwrite_chunk
+ * Purpose: Test the basic functionality of H5DOwrite_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -111,7 +111,7 @@ test_direct_chunk_write(hid_t did)
size_t data_size;
int i;
- TESTING("H5DOwrite_chunk wrapper");
+ HL_TESTING2("H5DOwrite_chunk wrapper");
/* Set the size of the chunk data */
data_size = CHUNK_NX * sizeof(int);
@@ -120,9 +120,9 @@ test_direct_chunk_write(hid_t did)
for (i = 0; i < CHUNK_NX; i++)
chunk_data[i] = (i * 10) + i;
- /* Write the direct chunk data repeatedly to cover all the chunks in the
+ /* Write the direct chunk data repeatedly to cover all the chunks in the
* dataset, using the direct writing function.
- */
+ */
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)
@@ -138,14 +138,14 @@ error:
return 1;
} /* test_direct_chunk_write() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_direct_chunk_read
+ * Function: test_direct_chunk_read
*
- * Purpose: Test the basic functionality of H5DOread_chunk
+ * Purpose: Test the basic functionality of H5DOread_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
@@ -169,7 +169,7 @@ test_direct_chunk_read(hid_t did)
int i,j;
- TESTING("H5DOread_chunk wrapper");
+ HL_TESTING2("H5DOread_chunk wrapper");
/* Create dataspaces for reading */
if ((mem_sid = H5Screate_simple(1, chunk_dims, NULL)) < 0)
@@ -232,15 +232,15 @@ error:
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test direct chunk write function H5DOwrite_chunk and
+ * Purpose: Test direct chunk write function H5DOwrite_chunk and
* chunk direct read function H5DOread_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
*-------------------------------------------------------------------------
*/
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index c30b572..e350533 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -169,7 +169,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("indexed image");
+ HL_TESTING2("indexed image");
/* Write image */
if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf1 ) < 0 )
@@ -205,7 +205,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("true color image");
+ HL_TESTING2("true color image");
/* Write image */
if ( H5IMmake_image_24bit( fid, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", buf2 ) )
@@ -232,7 +232,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("pallete functions");
+ HL_TESTING2("pallete functions");
if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 )
goto out;
@@ -351,7 +351,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image");
+ HL_TESTING2("make indexed image");
/* read first data file */
if (read_data(DATA_FILE1,&width,&height)<0)
@@ -364,7 +364,7 @@ static int test_data(void)
PASSED();
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/*-------------------------------------------------------------------------
* palette #1. rainbow palette. data is contained in "pal_rgb.h"
@@ -464,7 +464,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with pixel interlace");
+ HL_TESTING2("make true color image with pixel interlace");
/* read second data file */
if ((read_data(DATA_FILE2,&width,&height))<0)
@@ -481,7 +481,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with plane interlace");
+ HL_TESTING2("make true color image with plane interlace");
/* read third data file */
if ((read_data(DATA_FILE3,&width,&height))<0)
@@ -627,7 +627,7 @@ static int test_generate(void)
goto out;
if(n_elements > INT_MAX / (int)sizeof(float))
goto out;
-
+
data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
if(NULL == data)
goto out;
@@ -652,7 +652,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from all the data");
+ HL_TESTING2("make indexed image from all the data");
for ( i = 0; i < n_elements; i++ )
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
@@ -669,7 +669,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from land data");
+ HL_TESTING2("make indexed image from land data");
for ( i = 0; i < n_elements; i++ )
{
@@ -691,7 +691,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from sea data");
+ HL_TESTING2("make indexed image from sea data");
for ( i = 0; i < n_elements; i++ )
{
@@ -712,7 +712,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/* make a palette */
if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0)
@@ -815,7 +815,7 @@ static int read_data(const char* fname, /*IN*/
printf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
-
+
if(fscanf(f, "%d", &h) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
goto out;
@@ -870,7 +870,7 @@ static int read_data(const char* fname, /*IN*/
/* Indicate success */
ret_val = 1;
-out:
+out:
if(f)
HDfclose(f);
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 12a226a..e3cde5d 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -29,12 +29,12 @@
#define DSET_ONE "DSET_ONE"
#define DSET_ALLOC_LATE "DSET_ALLOC_LATE"
#define DSET_ALLOC_EARLY "DSET_ALLOC_EARLY"
-#define DSET_TWO "DSET_TWO"
-#define TWO_DIM_1 4
-#define TWO_DIM_2 10
-#define DSET_CMPD "DSET_CMPD"
-#define DSET_CMPD_ESC "DSET_CMPD_ESC"
-#define DSET_CMPD_TWO "DSET_CMPD_TWO"
+#define DSET_TWO "DSET_TWO"
+#define TWO_DIM_1 4
+#define TWO_DIM_2 10
+#define DSET_CMPD "DSET_CMPD"
+#define DSET_CMPD_ESC "DSET_CMPD_ESC"
+#define DSET_CMPD_TWO "DSET_CMPD_TWO"
#define DSET_NULL "DSET_NULL"
#define DSET_SCALAR "DSET_SCALAR"
@@ -53,63 +53,63 @@
#define INVALID_ESC_FIELDS2 "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
#define INVALID_ESC_FIELDS3 "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
-/*
+/*
* Test variations (retained original) for one-dimensional dataset:
- * Varies from 10->13; 10->9, 10->10, 10->1, 10->11
+ * Varies from 10->13; 10->9, 10->10, 10->1, 10->11
*/
#define ONE_NTESTS 5
int one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1};
-/*
+/*
* Test variations (retained original) for two-dimensional dataset:
- * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
- * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
- * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
+ * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
+ * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
+ * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
*/
-#define TWO_NTESTS 9
+#define TWO_NTESTS 9
int two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
- {-1,2}, {-1,-1}, {-1,0},
- {0,2}, {0,-1}, {0,0} };
+ {-1,2}, {-1,-1}, {-1,0},
+ {0,2}, {0,-1}, {0,0} };
/* Verify that the two input values are the same */
-#define VERIFY_EQUAL(_x, _y) \
-{ \
- long __x = (long)_x, __y = (long)_y; \
- if(__x != __y) TEST_ERROR \
+#define VERIFY_EQUAL(_x, _y) \
+{ \
+ long __x = (long)_x, __y = (long)_y; \
+ if(__x != __y) TEST_ERROR \
}
/* Temporary buffer for reading in the test file */
-#define TMP_BUF_SIZE 2048
+#define TMP_BUF_SIZE 2048
char g_tmp_buf[TMP_BUF_SIZE];
/* Macros for verifying compound fields */
/* Verify all fields */
-#define VERIFY_ELMTS_ALL(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field1, ent2.field1); \
- VERIFY_EQUAL(ent1.field2.a, ent2.field2.a); \
- VERIFY_EQUAL(ent1.field2.b.a, ent2.field2.b.a); \
- VERIFY_EQUAL(ent1.field2.b.b, ent2.field2.b.b); \
- VERIFY_EQUAL(ent1.field2.b.c, ent2.field2.b.c); \
- VERIFY_EQUAL(ent1.field2.c, ent2.field2.c); \
- VERIFY_EQUAL(ent1.field3, ent2.field3); \
- VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
+#define VERIFY_ELMTS_ALL(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field1, ent2.field1); \
+ VERIFY_EQUAL(ent1.field2.a, ent2.field2.a); \
+ VERIFY_EQUAL(ent1.field2.b.a, ent2.field2.b.a); \
+ VERIFY_EQUAL(ent1.field2.b.b, ent2.field2.b.b); \
+ VERIFY_EQUAL(ent1.field2.b.c, ent2.field2.b.c); \
+ VERIFY_EQUAL(ent1.field2.c, ent2.field2.c); \
+ VERIFY_EQUAL(ent1.field3, ent2.field3); \
+ VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
}
/* Verify fields selected in VALID_FIELDS1 */
-#define VERIFY_ELMTS_VALID1(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field1, ent2.field1); \
- VERIFY_EQUAL(ent1.field2_a, ent2.field2.a); \
- VERIFY_EQUAL(ent1.field3, ent2.field3); \
- VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
- VERIFY_EQUAL(ent1.field4.b, ent2.field4.b); \
+#define VERIFY_ELMTS_VALID1(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field1, ent2.field1); \
+ VERIFY_EQUAL(ent1.field2_a, ent2.field2.a); \
+ VERIFY_EQUAL(ent1.field3, ent2.field3); \
+ VERIFY_EQUAL(ent1.field4.a, ent2.field4.a); \
+ VERIFY_EQUAL(ent1.field4.b, ent2.field4.b); \
}
/* Verify fields selected in VALID_FIELDS2 */
-#define VERIFY_ELMTS_VALID2(ent1, ent2) { \
- VERIFY_EQUAL(ent1.field2_b_a, ent2.field2.b.a); \
- VERIFY_EQUAL(ent1.field2_c, ent2.field2.c); \
- VERIFY_EQUAL(ent1.field4_b, ent2.field4.b); \
+#define VERIFY_ELMTS_VALID2(ent1, ent2) { \
+ VERIFY_EQUAL(ent1.field2_b_a, ent2.field2.b.a); \
+ VERIFY_EQUAL(ent1.field2_c, ent2.field2.c); \
+ VERIFY_EQUAL(ent1.field4_b, ent2.field4.b); \
}
/* The types of 2-dimensional dataset: DSET_TWO or DSET_CMPD_TWO */
@@ -118,34 +118,34 @@ char g_tmp_buf[TMP_BUF_SIZE];
#define TWO_CMPD_VALID1 2 /* DSET_CMPD_TWO with VALID_FIELDS1 or VALID_ESC_FIELDS1 */
#define TWO_CMPD_VALID2 3 /* DSET_CMPD_TWO with VALID_FIELDS2 or VALID_ESC_FIELDS2 */
-#define VERIFY_ELMTS(type, k, ind, _ldbuf, _buf) { \
- if(type == TWO_NONE) { \
- int *iib = (int *)_ldbuf; \
- int *ib = (int *)_buf; \
- \
- VERIFY_EQUAL(iib[k], ib[ind + n]) \
- } else if(type == TWO_CMPD_NULL) { \
- set_t *ccb = (set_t *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_ALL(ccb[k], cb[ind + n]) \
- } else if(type == TWO_CMPD_VALID1) { \
- test_valid_fields1 *vb1 = (test_valid_fields1 *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_VALID1(vb1[k], cb[ind + n]) \
- } else if(type == TWO_CMPD_VALID2) { \
- test_valid_fields2 *vb2 = (test_valid_fields2 *)_ldbuf; \
- set_t *cb = (set_t *)_buf; \
- \
- VERIFY_ELMTS_VALID2(vb2[k], cb[ind + n]) \
- } \
+#define VERIFY_ELMTS(type, k, ind, _ldbuf, _buf) { \
+ if(type == TWO_NONE) { \
+ int *iib = (int *)_ldbuf; \
+ int *ib = (int *)_buf; \
+ \
+ VERIFY_EQUAL(iib[k], ib[ind + n]) \
+ } else if(type == TWO_CMPD_NULL) { \
+ set_t *ccb = (set_t *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_ALL(ccb[k], cb[ind + n]) \
+ } else if(type == TWO_CMPD_VALID1) { \
+ test_valid_fields1 *vb1 = (test_valid_fields1 *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_VALID1(vb1[k], cb[ind + n]) \
+ } else if(type == TWO_CMPD_VALID2) { \
+ test_valid_fields2 *vb2 = (test_valid_fields2 *)_ldbuf; \
+ set_t *cb = (set_t *)_buf; \
+ \
+ VERIFY_ELMTS_VALID2(vb2[k], cb[ind + n]) \
+ } \
}
/* Tests for test_LD_elmts_pipe() */
-#define ONE_TESTS 3
+#define ONE_TESTS 3
int onetests[ONE_TESTS] = {3, 9, 1};
-#define TWO_TESTS 5
+#define TWO_TESTS 5
int twotests[TWO_TESTS][2] = { {2,2}, {2,-1}, {2,0}, {-1,2}, {0,2} };
@@ -185,9 +185,9 @@ typedef struct set_t {
sub4_t field4;
} set_t;
-/* NOTE:
- * This will fail on heiwa and amani when VALID_FIELDS1 is "field1,field3,field4"
- * because of alignment problems:
+/* NOTE:
+ * This will fail on heiwa and amani when VALID_FIELDS1 is "field1,field3,field4"
+ * because of alignment problems:
* amani and heiwa - 8 byte alignment
* jam - 4 byte alignemnt
* This will need to be fixed in the library for H5Tget_native_type().
@@ -211,185 +211,185 @@ typedef struct test_valid_fields2 {
/* Temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
-#define TEST_BUF_SIZE 100
-int *iibuf; /* buffer for storing retrieved elements */
-int *ibuf; /* buffer for storing retrieved elements (integer) */
-set_t *cbuf; /* buffer for storing retrieved elemnets (compound) */
-set_t *ccbuf; /* buffer for storing retrieved elemnets (compound) */
-test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
-test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
-
-
-/*
+#define TEST_BUF_SIZE 100
+int *iibuf; /* buffer for storing retrieved elements */
+int *ibuf; /* buffer for storing retrieved elements (integer) */
+set_t *cbuf; /* buffer for storing retrieved elemnets (compound) */
+set_t *ccbuf; /* buffer for storing retrieved elemnets (compound) */
+test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */
+test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */
+
+
+/*
*********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_dims()
- * 1) An invalid dataset id
- * 2) "DSET_ALLOC_EARLY": NULL cur_dims
- * 3) "DSET_ALLOC_LATE": nonNULL cur_dims
- * 4) "DSET_CMPD_TWO": nonNULL cur_dims
- * 5) "DSET_NULL": nonNULL cur_dims
- * 6) "DSET_SCALAR": nonNULL cur_dims
+ * 1) An invalid dataset id
+ * 2) "DSET_ALLOC_EARLY": NULL cur_dims
+ * 3) "DSET_ALLOC_LATE": nonNULL cur_dims
+ * 4) "DSET_CMPD_TWO": nonNULL cur_dims
+ * 5) "DSET_NULL": nonNULL cur_dims
+ * 6) "DSET_SCALAR": nonNULL cur_dims
*
*********************************************************************************
*/
static herr_t
test_LD_dims_params(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
- hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
+ hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
hid_t invalid_id = -1;
- herr_t ret; /* return value */
+ herr_t ret; /* return value */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_dims");
+ HL_TESTING2("H5LDget_dset_dims");
/* 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
*/
H5E_BEGIN_TRY {
- ret = H5LDget_dset_dims(invalid_id, one_cur_dims);
+ ret = H5LDget_dset_dims(invalid_id, one_cur_dims);
} H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
- /*
+ /*
* 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);
+ ret = H5LDget_dset_dims(did, NULL);
} 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
*/
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
*/
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;
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_dims_params() */
-
-/*
+
+/*
*********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_dims()
* Verify that the dimension sizes retrieved via H5LDget_dset_dims() are correct
* for the following cases:
*
- * DSET_ONE: one-dimensional dataset
- * 1. Increase dims[0]
- * 2. Decrease dims[0]
- * 3. same dims[0]
- * 4. Decrease dims[0]
- * 5. Increase dims[0]
+ * DSET_ONE: one-dimensional dataset
+ * 1. Increase dims[0]
+ * 2. Decrease dims[0]
+ * 3. same dims[0]
+ * 4. Decrease dims[0]
+ * 5. Increase dims[0]
*
- * one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}
- * Varies from 10->3; 10->9, 10->10, 10->1, 10->11
+ * one_tests[ONE_NTESTS] = {3, -1, 0, -9, 1}
+ * Varies from 10->3; 10->9, 10->10, 10->1, 10->11
*
- * DSET_TWO: two-dimensional dataset
- * 1. Increase dims[0], increase dims[1]
- * 2. Increase dims[0], decrease dims[1]
- * 3. Increase dims[0], same dims[1]
- * 4. Decrease dims[0], increase dims[1]
- * 5. Decrease dims[0], decrease dims[1]
- * 6. Decrease dims[0], same dims[1]
- * 7. same dims[0], increase dims[1]
- * 8. same dims[0], decrease dims[1]
- * 9. same dims[0], same dims[1]
+ * DSET_TWO: two-dimensional dataset
+ * 1. Increase dims[0], increase dims[1]
+ * 2. Increase dims[0], decrease dims[1]
+ * 3. Increase dims[0], same dims[1]
+ * 4. Decrease dims[0], increase dims[1]
+ * 5. Decrease dims[0], decrease dims[1]
+ * 6. Decrease dims[0], same dims[1]
+ * 7. same dims[0], increase dims[1]
+ * 8. same dims[0], decrease dims[1]
+ * 9. same dims[0], same dims[1]
*
- * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
- * {-1,2}, {-1,-1}, {-1,0},
- * {0,2}, {0,-1}, {0,0} }
- * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
- * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
- * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
+ * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-1}, {2,0},
+ * {-1,2}, {-1,-1}, {-1,0},
+ * {0,2}, {0,-1}, {0,0} }
+ * Varies from {4,10}->{6,12}; {4,10}->{6,9}; {4,10}->{6,10};
+ * {4,10}->{3,12}; {4,10}->{3,9}; {4,10}->{3,10};
+ * {4,10}->{4,12}; {4,10}->{4,9}; {4,10}->{4,10}
*
*********************************************************************************
*/
static herr_t
test_LD_dims(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hsize_t one_prev_dims[1]; /* original dimension sizes for 1-dimensonal dataset */
- hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
- hsize_t one_ext_dims[1]; /* extended dimension sizes for 1-dimensonal dataset */
- hsize_t two_prev_dims[2]; /* original dimension sizes for 2-dimensional dataset */
- hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
- hsize_t two_ext_dims[2]; /* extended dimension sizes for 2-dimensional dataset*/
- int i; /* local index variable */
-
- TESTING("H5LDget_dset_dims with H5Dset_extent");
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hsize_t one_prev_dims[1]; /* original dimension sizes for 1-dimensonal dataset */
+ hsize_t one_cur_dims[1]; /* current dimension sizes for 1-dimensonal dataset */
+ hsize_t one_ext_dims[1]; /* extended dimension sizes for 1-dimensonal dataset */
+ hsize_t two_prev_dims[2]; /* original dimension sizes for 2-dimensional dataset */
+ hsize_t two_cur_dims[2]; /* current dimension sizes for 2-dimensional dataset */
+ hsize_t two_ext_dims[2]; /* extended dimension sizes for 2-dimensional dataset*/
+ int i; /* local index variable */
+
+ HL_TESTING2("H5LDget_dset_dims with H5Dset_extent");
/* Make a copy of the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
@@ -397,75 +397,75 @@ test_LD_dims(const char *file)
/* 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++) {
- /* Set up the extended dimension sizes */
- one_ext_dims[0] = (hsize_t)((int)one_prev_dims[0] + one_tests[i]);
+ /* Set up the extended dimension sizes */
+ one_ext_dims[0] = (hsize_t)((int)one_prev_dims[0] + one_tests[i]);
- /* Change the dimension size */
- if(H5Dset_extent(did, one_ext_dims) < 0)
- FAIL_STACK_ERROR
+ /* Change the dimension size */
+ if(H5Dset_extent(did, one_ext_dims) < 0)
+ FAIL_STACK_ERROR
- /* Retrieve the dimension size */
- if(H5LDget_dset_dims(did, one_cur_dims) < 0)
- FAIL_STACK_ERROR
+ /* Retrieve the dimension size */
+ if(H5LDget_dset_dims(did, one_cur_dims) < 0)
+ FAIL_STACK_ERROR
- /* Verify that the retrieved dimension size is correct as expected */
- VERIFY_EQUAL(one_cur_dims[0], one_ext_dims[0])
+ /* Verify that the retrieved dimension size is correct as expected */
+ VERIFY_EQUAL(one_cur_dims[0], one_ext_dims[0])
}
/* 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++) {
- /* Set up the extended dimension sizes */
- two_ext_dims[0] = (hsize_t)((int)two_prev_dims[0] + two_tests[i][0]);
- two_ext_dims[1] = (hsize_t) ((int)two_prev_dims[1] + two_tests[i][1]);
+ /* Set up the extended dimension sizes */
+ two_ext_dims[0] = (hsize_t)((int)two_prev_dims[0] + two_tests[i][0]);
+ two_ext_dims[1] = (hsize_t) ((int)two_prev_dims[1] + two_tests[i][1]);
- /* Change the dimension sizes */
- if(H5Dset_extent(did, two_ext_dims) < 0)
- FAIL_STACK_ERROR
+ /* Change the dimension sizes */
+ if(H5Dset_extent(did, two_ext_dims) < 0)
+ FAIL_STACK_ERROR
- /* Retrieve the dimension sizes */
- if(H5LDget_dset_dims(did, two_cur_dims) < 0)
- FAIL_STACK_ERROR
+ /* Retrieve the dimension sizes */
+ if(H5LDget_dset_dims(did, two_cur_dims) < 0)
+ FAIL_STACK_ERROR
- /* Verify that the retrieved dimension sizes are correct as expected */
- VERIFY_EQUAL(two_cur_dims[0], two_ext_dims[0])
- VERIFY_EQUAL(two_cur_dims[1], two_ext_dims[1])
+ /* Verify that the retrieved dimension sizes are correct as expected */
+ VERIFY_EQUAL(two_cur_dims[0], two_ext_dims[0])
+ VERIFY_EQUAL(two_cur_dims[1], two_ext_dims[1])
} /* end TWO_NTESTS */
/* 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);
@@ -475,172 +475,172 @@ test_LD_dims(const char *file)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_dims() */
-
-/*
+
+/*
**********************************************************************************
*
* Testing for the High Level public routine: H5LDget_dset_type_size()
* Verify that the data type size returned via H5LDget_dset_type_size()
* are correct for the following cases:
*
- * Verify failure for an invalid dataset id
+ * Verify failure for an invalid dataset id
*
- * DSET_CMPD: one-dimensional dataset with compound type
- * 1. The whole element
- * 2. VALID_FIELDS1: "field1,field2.a,field3,field4"
- * 3. VALID_FIELDS2: "field2.b.a,field2.c,field4.b"
- * 4. INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
- * 5. INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
- * 6. INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
+ * DSET_CMPD: one-dimensional dataset with compound type
+ * 1. The whole element
+ * 2. VALID_FIELDS1: "field1,field2.a,field3,field4"
+ * 3. VALID_FIELDS2: "field2.b.a,field2.c,field4.b"
+ * 4. INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
+ * 5. INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
+ * 6. INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
*
- * DSET_CMPD_ESC: one-dimensional dataset with compound type and
- * member names with escape/separator characters
- * 1. The whole element
- * 2. VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\,"
- * 3. VALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,"
- * 4. INVALID_ESC_FIELDS1: "field2\\..\\,k.a,field2\\..\\\\c,field4\\,.k\\,"
- * 5. INVALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
- * 6. INVALID_ESC_FIELDS3: "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
+ * DSET_CMPD_ESC: one-dimensional dataset with compound type and
+ * member names with escape/separator characters
+ * 1. The whole element
+ * 2. VALID_ESC_FIELDS1: "field\\,1,field2\\..\\.a,field\\\\3,field4\\,"
+ * 3. VALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,"
+ * 4. INVALID_ESC_FIELDS1: "field2\\..\\,k.a,field2\\..\\\\c,field4\\,.k\\,"
+ * 5. INVALID_ESC_FIELDS2: "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\,."
+ * 6. INVALID_ESC_FIELDS3: "field2\\..\\,,b.a,field2\\..\\\\c,field4\\,.b\\,"
*
**********************************************************************************
*/
static int
test_LD_size(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtid=-1; /* dataset's datatype identifier */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtid=-1; /* dataset's datatype identifier */
hid_t invalid_id=-1;
- hid_t memb0_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb1_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb2_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb3_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb_tid=-1; /* type identifier for a member in the compound type */
- hid_t memb_tid2=-1; /* type identifier for a member in the compound type */
- size_t dsize; /* size of the dataset's datatype */
- size_t ck_dsize; /* size of the dataset's datatype to be checked against */
+ hid_t memb0_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb1_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb2_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb3_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb_tid=-1; /* type identifier for a member in the compound type */
+ hid_t memb_tid2=-1; /* type identifier for a member in the compound type */
+ size_t dsize; /* size of the dataset's datatype */
+ size_t ck_dsize; /* size of the dataset's datatype to be checked against */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_type_size");
+ HL_TESTING2("H5LDget_dset_type_size");
/* 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
*/
H5E_BEGIN_TRY {
- dsize = H5LDget_dset_type_size(invalid_id, NULL);
+ dsize = H5LDget_dset_type_size(invalid_id, NULL);
} H5E_END_TRY;
VERIFY_EQUAL(dsize, 0)
- /*
+ /*
* Testing one-dimensional dataset with compound datatype:
- * DSET_CMPD
+ * DSET_CMPD
*/
/* 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
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)
/*
- * Verify failure for the following invalid nested fields:
- * INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
+ * Verify failure for the following invalid nested fields:
+ * INVALID_FIELDS1: "field2.k.a,field2.c,field4.k"
* INVALID_FIELDS2: "field2.b.a,field2.c,field4.b."
* INVALID_FIELDS3: "field2.b.a,,field2.c,field4.b"
*/
@@ -655,119 +655,119 @@ test_LD_size(const char *file)
/* Verify failure for case #6 */
dsize = H5LDget_dset_type_size(did, INVALID_FIELDS3);
VERIFY_EQUAL(dsize, 0)
-
+
/* 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
- * member names consisting of escape/separator characters:
- * DSET_CMPD_ESC
+ * member names consisting of escape/separator characters:
+ * DSET_CMPD_ESC
*/
/* 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
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)
- /* Obtain datatype size for VALID_ESC_FIELDS2:
- "field2\\..\\,b.a,field2\\..\\\\c,field4\\,.b\\," */
+ /* 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)
/*
- * Verify failure for the following invalid nested fields:
+ * Verify failure for the following invalid nested fields:
* INVALID_ESC_FIELDS1: "field2\..\,k.a,field2\..\\c,field4\,.k\,"
* INVALID_ESC_FIELDS2: "field2\..\,b.a,field2\..\\c,field4\,.b\,."
* INVALID_ESC_FIELDS3: "field2\..\,,b.a,field2\..\\c,field4\,.b\,"
@@ -786,90 +786,90 @@ 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;
error:
H5E_BEGIN_TRY {
- H5Tclose(memb0_tid);
- H5Tclose(memb1_tid);
- H5Tclose(memb2_tid);
- H5Tclose(memb3_tid);
- H5Tclose(memb_tid);
- H5Tclose(memb_tid2);
- H5Tclose(dtid);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(memb0_tid);
+ H5Tclose(memb1_tid);
+ H5Tclose(memb2_tid);
+ H5Tclose(memb3_tid);
+ H5Tclose(memb_tid);
+ H5Tclose(memb_tid2);
+ H5Tclose(dtid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_size() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify failures when calling H5LDget_dset_elmts() with the following
- * invalid conditions:
+ * Verify failures when calling H5LDget_dset_elmts() with the following
+ * invalid conditions:
*
- * A. DSET_TWO: two-dimensional dataset
- * 1. CUR_DIMS and PREV_DIMS are NULL
- * 2. PREV_DIMS is NULL
- * 3. CUR_DIMS is NULL
- * 4. FIELDS is nonnull but the dataset is not compound datatype
- * 5. BUF is NULL
- * 6. CUR_DIMS is not greater than PREV_DIMS
+ * A. DSET_TWO: two-dimensional dataset
+ * 1. CUR_DIMS and PREV_DIMS are NULL
+ * 2. PREV_DIMS is NULL
+ * 3. CUR_DIMS is NULL
+ * 4. FIELDS is nonnull but the dataset is not compound datatype
+ * 5. BUF is NULL
+ * 6. CUR_DIMS is not greater than PREV_DIMS
*
- * B. DSET_CMPD: one-dimensional dataset with compound type
- * 1. Invalid dataset id
- * 2. FIELDS are not valid members in the compound type
+ * B. DSET_CMPD: one-dimensional dataset with compound type
+ * 1. Invalid dataset id
+ * 2. FIELDS are not valid members in the compound type
*
**************************************************************************************
*/
static int
test_LD_elmts_invalid(const char *file)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t sid=-1; /* dataspace identifier */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t sid=-1; /* dataspace identifier */
hid_t invalid_id=-1;
- int ret; /* return value */
- hsize_t cur_dims[2]; /* current dimension sizes of the dataset */
- hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
- char tbuf[2]; /* temporary buffer for testing */
- int ndims; /* # of dimension sizes */
- int i; /* local index variable */
+ int ret; /* return value */
+ hsize_t cur_dims[2]; /* current dimension sizes of the dataset */
+ hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
+ char tbuf[2]; /* temporary buffer for testing */
+ int ndims; /* # of dimension sizes */
+ int i; /* local index variable */
const char *filename = H5_get_srcdir_filename(file);
- TESTING("H5LDget_dset_elmts on invalid conditions");
+ HL_TESTING2("H5LDget_dset_elmts on invalid conditions");
/* 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
*/
/* 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);
@@ -884,15 +884,15 @@ 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++)
- prev_dims[i] = cur_dims[i] - 1;
+ prev_dims[i] = cur_dims[i] - 1;
/* Verify failure from case #4: FIELDS is nonNULL but the dataset is not compound datatype */
ret = H5LDget_dset_elmts(did, prev_dims, cur_dims, "field1", tbuf);
@@ -910,26 +910,26 @@ 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:
- * DSET_CMPD
+ * DSET_CMPD
*/
/* Verify failure from case #1: an invalid dataset id */
H5E_BEGIN_TRY {
- ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf);
+ ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf);
} H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
/* 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;
@@ -940,118 +940,118 @@ 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;
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_invalid() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected
- * when the dataset's dimension sizes are changed according to one_tests[]:
+ * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected
+ * when the dataset's dimension sizes are changed according to one_tests[]:
*
- * one-dimensional dataset :
- * DSET_ONE with NULL fields
- * DSET_CMPD with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
- * DSET_CMPD_ESC with fields: NULL, VALID_ESC_FIELDS1, VALID_ESC_FIELDS2
- *
- * case #1. increase dims[0]
- * case #2. decrease dims[0] (failure)
- * case #3. same dims[0] (failure)
- * case #4. decrease dims[0] (failure)
- * case #5. increase dims[0]
+ * one-dimensional dataset :
+ * DSET_ONE with NULL fields
+ * DSET_CMPD with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ * DSET_CMPD_ESC with fields: NULL, VALID_ESC_FIELDS1, VALID_ESC_FIELDS2
+ *
+ * case #1. increase dims[0]
+ * case #2. decrease dims[0] (failure)
+ * case #3. same dims[0] (failure)
+ * case #4. decrease dims[0] (failure)
+ * case #5. increase dims[0]
*
**************************************************************************************
*/
static herr_t
test_LD_elmts_one(const char *file, const char *dname, const char *fields)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtype=-1; /* dataset's data type */
- hsize_t ext_dims[1]; /* extended dimension sizes of the dataset */
- hsize_t prev_dims[1]; /* previous dimension sizes of the dataset */
- int i, j; /* local index variable */
- int ret = 0; /* return value */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtype=-1; /* dataset's data type */
+ hsize_t ext_dims[1]; /* extended dimension sizes of the dataset */
+ hsize_t prev_dims[1]; /* previous dimension sizes of the dataset */
+ int i, j; /* local index variable */
+ int ret = 0; /* return value */
- TESTING("H5LDget_dset_elmts: one-dimensional dataset");
+ HL_TESTING2("H5LDget_dset_elmts: one-dimensional dataset");
/* Copy the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
TEST_ERROR
for(i = 0; i < TEST_BUF_SIZE; i++) {
- cbuf[i].field1 = i;
- cbuf[i].field2.a = i;
- cbuf[i].field2.b.a = i;
- cbuf[i].field2.b.b = i;
- cbuf[i].field2.b.c = i;
- cbuf[i].field2.c = i;
- cbuf[i].field3 = (double)i;
- cbuf[i].field4.a = i;
- cbuf[i].field4.b = i;
- ibuf[i] = i;
+ cbuf[i].field1 = i;
+ cbuf[i].field2.a = i;
+ cbuf[i].field2.b.a = i;
+ cbuf[i].field2.b.b = i;
+ cbuf[i].field2.b.c = i;
+ cbuf[i].field2.c = i;
+ cbuf[i].field3 = (double)i;
+ cbuf[i].field4.a = i;
+ cbuf[i].field4.b = i;
+ ibuf[i] = i;
} /* end for */
/* 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++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
-
- ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
-
- /* Change the dimension sizes of the dataset */
- if(H5Dset_extent(did, ext_dims) < 0)
- 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
- } /* end if */
+ HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+
+ ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
+
+ /* Change the dimension sizes of the dataset */
+ if(H5Dset_extent(did, ext_dims) < 0)
+ 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
+ } /* end if */
else if(!HDstrcmp(dname, DSET_ONE)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
- } /* end if */
-
- /* There are changes in dimension sizes */
- if(one_tests[i] > 0) {
- if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
- if(fields) {
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end if */
+
+ /* There are changes in dimension sizes */
+ if(one_tests[i] > 0) {
+ if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if(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)
@@ -1067,24 +1067,24 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
VERIFY_ELMTS_VALID2(vbuf2[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end else-if */
else
- TEST_ERROR
- } /* end if */
+ TEST_ERROR
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- 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 */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
+ 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 */
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
- TEST_ERROR
- for(j = 0; j < one_tests[i]; j++)
- VERIFY_EQUAL(iibuf[j], ibuf[prev_dims[0] + (hsize_t)j])
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
+ TEST_ERROR
+ for(j = 0; j < one_tests[i]; j++)
+ VERIFY_EQUAL(iibuf[j], ibuf[prev_dims[0] + (hsize_t)j])
+ } /* end else */
+ } /* end if */
else {
/* Verify failure when changes between prev_dims and ext_dims are same/decrease */
ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
@@ -1108,56 +1108,56 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
error:
H5E_BEGIN_TRY {
- H5Tclose(dtype);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(dtype);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_one() */
-
+
/*
**************************************************************************************
*
- * Helper routine to verify elements of a 2-dimensional dataset
- * _ldbuf contains the elements retrieved via H5LDget_dset_elmts()
- * _buf contains the data written to the dataset
+ * Helper routine to verify elements of a 2-dimensional dataset
+ * _ldbuf contains the elements retrieved via H5LDget_dset_elmts()
+ * _buf contains the data written to the dataset
*
- * e.g. prev_dims[2] = {4, 6}; ext_dims[2] = {6, 10}
- * elements marked in 'v' in _buf are compared to elements in _ldbuf
- * 0 1 2 3 4 5 | 6 7 8 9
- * 0 | v v v v
- * 1 | v v v v
- * 2 | v v v v
- * 3 | v v v v
- * ---------------------
- * 4 v v v v v v v v v v
- * 5 v v v v v v v v v v
+ * e.g. prev_dims[2] = {4, 6}; ext_dims[2] = {6, 10}
+ * elements marked in 'v' in _buf are compared to elements in _ldbuf
+ * 0 1 2 3 4 5 | 6 7 8 9
+ * 0 | v v v v
+ * 1 | v v v v
+ * 2 | v v v v
+ * 3 | v v v v
+ * ---------------------
+ * 4 v v v v v v v v v v
+ * 5 v v v v v v v v v v
*
**************************************************************************************
*/
static herr_t
verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf)
{
- int k, m; /* Local index variable */
+ int k, m; /* Local index variable */
- k = 0;
+ k = 0;
for(m = 0; m < (int)ext_dims[0]; m++) {
- int n, ind; /* Local index variable */
-
- ind = m * (int)ext_dims[1];
- if(m < (int)prev_dims[0]) {
- for(n = (int)prev_dims[1]; n < (int)ext_dims[1]; n++) {
- VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
- ++k;
- } /* end for */
- } /* end if */
- else {
- for(n = 0; n < (int)ext_dims[1]; n++) {
- VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
- ++k;
- } /* end for */
- } /* end else */
+ int n, ind; /* Local index variable */
+
+ ind = m * (int)ext_dims[1];
+ if(m < (int)prev_dims[0]) {
+ for(n = (int)prev_dims[1]; n < (int)ext_dims[1]; n++) {
+ VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
+ ++k;
+ } /* end for */
+ } /* end if */
+ else {
+ for(n = 0; n < (int)ext_dims[1]; n++) {
+ VERIFY_ELMTS(type, k, ind, _ldbuf, _buf)
+ ++k;
+ } /* end for */
+ } /* end else */
} /* end for */
return(0);
@@ -1166,106 +1166,106 @@ error:
return(-1);
} /* verify_elmts_two() */
-
-/*
+
+/*
**************************************************************************************
* Testing for the High Level public routine: H5LDget_dset_elmts()
- * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected when
- * the datset's dimension sizes are changed accordingly to two_tests[]:
+ * Verify elements retrieved via H5LDget_dset_elmts() are correct as expected when
+ * the datset's dimension sizes are changed accordingly to two_tests[]:
*
- * two-dimensional dataset: DSET_TWO with NULL fields
- * DSET_CMPD_TWO with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ * two-dimensional dataset: DSET_TWO with NULL fields
+ * DSET_CMPD_TWO with fields: NULL, VALID_FIELDS1, VALID_FIELDS2
+ *
+ * dims[0] dims[1]
+ * ------- -------
+ * case #1: increase increase
+ * case #2: increase decrease
+ * case #3: increase same
+ * case #4: decrease increase
+ * case #5: decrease decrease (failure)
+ * case #6: decrease same (failure)
+ * case #7: same increase
+ * case #8: same decrease (failure)
+ * case #9: same same (failure)
*
- * dims[0] dims[1]
- * ------- -------
- * case #1: increase increase
- * case #2: increase decrease
- * case #3: increase same
- * case #4: decrease increase
- * case #5: decrease decrease (failure)
- * case #6: decrease same (failure)
- * case #7: same increase
- * case #8: same decrease (failure)
- * case #9: same same (failure)
- *
**************************************************************************************
*/
static herr_t
test_LD_elmts_two(const char *file, const char *dname, const char *fields)
{
- hid_t fid=-1; /* file identifier */
- hid_t did=-1; /* dataset identifier */
- hid_t dtype=-1; /* dataset's data type */
- hsize_t ext_dims[2]; /* extended dimension sizes of the dataset */
- hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
- int i; /* local index variable */
- int ret = 0; /* return value */
+ hid_t fid=-1; /* file identifier */
+ hid_t did=-1; /* dataset identifier */
+ hid_t dtype=-1; /* dataset's data type */
+ hsize_t ext_dims[2]; /* extended dimension sizes of the dataset */
+ hsize_t prev_dims[2]; /* previous dimension sizes of the dataset */
+ int i; /* local index variable */
+ int ret = 0; /* return value */
- TESTING("H5LDget_dset_elmts: two-dimensional dataset");
+ HL_TESTING2("H5LDget_dset_elmts: two-dimensional dataset");
/* Copy the test file */
if(h5_make_local_copy(file, COPY_FILENAME) < 0)
TEST_ERROR
for(i = 0; i < TEST_BUF_SIZE; i++) {
- cbuf[i].field1 = i;
- cbuf[i].field2.a = i;
- cbuf[i].field2.b.a = i;
- cbuf[i].field2.b.b = i;
- cbuf[i].field2.b.c = i;
- cbuf[i].field2.c = i;
- cbuf[i].field3 = (double)i;
- cbuf[i].field4.a = i;
- cbuf[i].field4.b = i;
- ibuf[i] = i;
+ cbuf[i].field1 = i;
+ cbuf[i].field2.a = i;
+ cbuf[i].field2.b.a = i;
+ cbuf[i].field2.b.b = i;
+ cbuf[i].field2.b.c = i;
+ cbuf[i].field2.c = i;
+ cbuf[i].field3 = (double)i;
+ cbuf[i].field4.a = i;
+ cbuf[i].field4.b = i;
+ ibuf[i] = i;
} /* end for */
/* 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++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
-
- ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
- ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
-
- /* Change the dimension sizes of the dataset */
- if(H5Dset_extent(did, ext_dims) < 0)
- 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
- } /* end if */
+ HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+
+ ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
+ ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
+
+ /* Change the dimension sizes of the dataset */
+ if(H5Dset_extent(did, ext_dims) < 0)
+ 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
+ } /* end if */
else if(!HDstrcmp(dname, DSET_TWO)) {
- if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
- FAIL_STACK_ERROR
- } /* end else-if */
+ if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
+ FAIL_STACK_ERROR
+ } /* end else-if */
else
TEST_ERROR
- /* There are changes in dimension sizes */
- if(two_tests[i][0] > 0 || two_tests[i][1] > 0) {
- if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
- if(fields) {
+ /* There are changes in dimension sizes */
+ if(two_tests[i][0] > 0 || two_tests[i][1] > 0) {
+ if(!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if(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)
@@ -1282,37 +1282,37 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
} /* end else-if */
else
TEST_ERROR
- } /* end if */
+ } /* end if */
else {
- /* Retrieve the elmemts in BUF */
- if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
- TEST_ERROR
- if(verify_elmts_two(TWO_CMPD_NULL, ext_dims, prev_dims, ccbuf, cbuf) < 0)
- TEST_ERROR
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, ccbuf) < 0)
+ TEST_ERROR
+ if(verify_elmts_two(TWO_CMPD_NULL, ext_dims, prev_dims, ccbuf, cbuf) < 0)
+ 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
- if(verify_elmts_two(TWO_NONE, ext_dims, prev_dims, iibuf, ibuf) < 0)
- TEST_ERROR
- } /* end else */
- } /* end if */
+ /* Retrieve the elmemts in BUF */
+ if(H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf) < 0)
+ TEST_ERROR
+ if(verify_elmts_two(TWO_NONE, ext_dims, prev_dims, iibuf, ibuf) < 0)
+ TEST_ERROR
+ } /* end else */
+ } /* end if */
else {
- /* Verify failure when changes between prev_dims and ext_dims are same/decrease */
- ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
- VERIFY_EQUAL(ret, FAIL)
- } /* end else */
+ /* Verify failure when changes between prev_dims and ext_dims are same/decrease */
+ ret = H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, iibuf);
+ VERIFY_EQUAL(ret, FAIL)
+ } /* end else */
} /* end for */
/* 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);
@@ -1322,16 +1322,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
error:
H5E_BEGIN_TRY {
- H5Tclose(dtype);
- H5Dclose(did);
- H5Fclose(fid);
+ H5Tclose(dtype);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return(-1);
} /* test_LD_elmts_two() */
/*
- * Tests for High Level routines:
- * H5LDget_dset_dims(), H5LDget_dset_elmts, H5LDget_dset_type_size()
+ * Tests for High Level routines:
+ * H5LDget_dset_dims(), H5LDget_dset_elmts, H5LDget_dset_type_size()
*/
int main(void)
{
@@ -1339,60 +1339,60 @@ int main(void)
/* Set up temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
if(NULL == (ibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (iibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (cbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (ccbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (vbuf1 = (test_valid_fields1 *)HDmalloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(NULL == (vbuf2 = (test_valid_fields2 *)HDmalloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
- /*
- * Testing H5LDget_dset_dims()
+ /*
+ * Testing H5LDget_dset_dims()
*/
nerrors += test_LD_dims_params(FILE);
nerrors += test_LD_dims(FILE);
- /*
- * Testing H5LDget_dset_type_size()
+ /*
+ * Testing H5LDget_dset_type_size()
*/
nerrors += test_LD_size(FILE);
- /*
+ /*
* Testing invalid conditions for H5LDget_dset_elmts()
*/
nerrors += test_LD_elmts_invalid(FILE);
- /*
- * Testing H5LDget_dset_elmts():
- * 1-dimensional dataset
+ /*
+ * Testing H5LDget_dset_elmts():
+ * 1-dimensional dataset
*/
nerrors += test_LD_elmts_one(FILE, DSET_ONE, NULL);
- /*
- * Testing H5LDget_dset_elmts():
- * 1-dimensional dataset w/ compound datatype
+ /*
+ * Testing H5LDget_dset_elmts():
+ * 1-dimensional dataset w/ compound datatype
*/
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, NULL);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, VALID_FIELDS1);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD, VALID_FIELDS2);
- /*
+ /*
* Testing H5LDget_dset_elmts():
- * 1-dimensional dataset with compound datatype and
- * member names with escape/separator characters
+ * 1-dimensional dataset with compound datatype and
+ * member names with escape/separator characters
*/
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, NULL);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, VALID_ESC_FIELDS1);
nerrors += test_LD_elmts_one(FILE, DSET_CMPD_ESC, VALID_ESC_FIELDS2);
- /*
+ /*
* Testing H5LDget_dset_elmts() for 2-dimensional datasets
*/
nerrors += test_LD_elmts_two(FILE, DSET_TWO, NULL);
@@ -1416,7 +1416,7 @@ int main(void)
/* check for errors */
if(nerrors)
- goto error;
+ goto error;
puts("All tests for H5LD high level routines passed.");
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 51ab72b..e6b4668 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -87,7 +87,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset");
+ HL_TESTING2("H5LTmake_dataset");
/* Make dataset */
if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 )
@@ -118,7 +118,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTread_dataset");
+ HL_TESTING2("H5LTread_dataset");
if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 )
goto out;
@@ -143,7 +143,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_char");
+ HL_TESTING2("H5LTmake_dataset_char");
/* Make dataset char */
if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 )
@@ -179,7 +179,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_short");
+ HL_TESTING2("H5LTmake_dataset_short");
/* Make dataset short */
if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 )
@@ -214,7 +214,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_int");
+ HL_TESTING2("H5LTmake_dataset_int");
/* Make dataset int */
if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 )
@@ -250,7 +250,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_long");
+ HL_TESTING2("H5LTmake_dataset_long");
/* Make dataset long */
if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 )
@@ -286,7 +286,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_float");
+ HL_TESTING2("H5LTmake_dataset_float");
/* Make dataset float */
if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 )
@@ -322,7 +322,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_double");
+ HL_TESTING2("H5LTmake_dataset_double");
/* Make dataset double */
if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 )
@@ -358,7 +358,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_string");
+ HL_TESTING2("H5LTmake_dataset_string");
/* Make dataset string */
if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 )
@@ -517,7 +517,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_string");
+ HL_TESTING2("H5LTset_attribute_string");
/* Set the attribute */
if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 )
@@ -530,7 +530,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_string");
+ HL_TESTING2("H5LTget_attribute_string");
/* Get the attribute */
@@ -550,7 +550,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_char");
+ HL_TESTING2("H5LTset_attribute_char");
/* Set the attribute */
if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 )
@@ -563,7 +563,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_char");
+ HL_TESTING2("H5LTget_attribute_char");
/* Get the attribute */
if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 )
@@ -594,7 +594,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_short");
+ HL_TESTING2("H5LTset_attribute_short");
/* Set the attribute */
if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 )
@@ -608,7 +608,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_short");
+ HL_TESTING2("H5LTget_attribute_short");
/* Get the attribute */
if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 )
@@ -640,7 +640,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_int");
+ HL_TESTING2("H5LTset_attribute_int");
/* Set the attribute */
if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 )
@@ -661,7 +661,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_int");
+ HL_TESTING2("H5LTget_attribute_int");
/* Get the attribute */
if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 )
@@ -712,7 +712,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_long");
+ HL_TESTING2("H5LTset_attribute_long");
/* Set the attribute */
if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 )
@@ -725,7 +725,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_long");
+ HL_TESTING2("H5LTget_attribute_long");
/* Get the attribute */
if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 )
@@ -756,7 +756,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uchar");
+ HL_TESTING2("H5LTset_attribute_uchar");
/* Set the attribute */
if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 )
@@ -769,7 +769,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uchar");
+ HL_TESTING2("H5LTget_attribute_uchar");
/* Get the attribute */
if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 )
@@ -800,7 +800,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ushort");
+ HL_TESTING2("H5LTset_attribute_ushort");
/* Set the attribute */
if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 )
@@ -814,7 +814,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ushort");
+ HL_TESTING2("H5LTget_attribute_ushort");
/* Get the attribute */
if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 )
@@ -846,7 +846,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uint");
+ HL_TESTING2("H5LTset_attribute_uint");
/* Set the attribute */
if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 )
@@ -859,7 +859,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uint");
+ HL_TESTING2("H5LTget_attribute_uint");
/* Get the attribute */
if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 )
@@ -890,7 +890,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ulong");
+ HL_TESTING2("H5LTset_attribute_ulong");
/* Set the attribute */
if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 )
@@ -903,7 +903,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ulong");
+ HL_TESTING2("H5LTget_attribute_ulong");
/* Get the attribute */
if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 )
@@ -935,7 +935,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_float");
+ HL_TESTING2("H5LTset_attribute_float");
/* Set the attribute */
if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 )
@@ -948,7 +948,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_float");
+ HL_TESTING2("H5LTget_attribute_float");
/* Get the attribute */
@@ -980,7 +980,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_double");
+ HL_TESTING2("H5LTset_attribute_double");
/* Set the attribute */
if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 )
@@ -993,7 +993,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_double");
+ HL_TESTING2("H5LTget_attribute_double");
/* Get the attribute */
if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 )
@@ -1026,7 +1026,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*/
- TESTING("H5LTget_attribute_ndims");
+ HL_TESTING2("H5LTget_attribute_ndims");
if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 )
return -1;
@@ -1042,7 +1042,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_info");
+ HL_TESTING2("H5LTget_attribute_info");
if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * (size_t)rank_out ))) return -1;
@@ -1079,7 +1079,7 @@ static int test_integers(void)
char* dt_str;
size_t str_len;
- TESTING3("\n text for integer types");
+ HL_TESTING3("\n text for integer types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_INT\n", H5LT_DDL))<0)
goto out;
@@ -1136,7 +1136,7 @@ static int test_fps(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for floating-point types");
+ HL_TESTING3(" text for floating-point types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_LDOUBLE\n", H5LT_DDL))<0)
goto out;
@@ -1197,7 +1197,7 @@ static int test_strings(void)
char* dt_str = NULL;
size_t str_len;
- TESTING3(" text for string types");
+ HL_TESTING3(" text for string types");
if((dtype = H5LTtext_to_dtype("H5T_STRING { STRSIZE 13; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; }", H5LT_DDL))<0)
goto out;
@@ -1328,7 +1328,7 @@ static int test_opaques(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for opaque types");
+ HL_TESTING3(" text for opaque types");
if((dtype = H5LTtext_to_dtype("H5T_OPAQUE { OPQ_SIZE 19; OPQ_TAG \"This is a tag for opaque type\"; }", H5LT_DDL))<0)
goto out;
@@ -1385,7 +1385,7 @@ static int test_enums(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for enum types");
+ HL_TESTING3(" text for enum types");
if((dtype = H5LTtext_to_dtype("H5T_ENUM { H5T_STD_I32LE; \"RED\" 5; \"GREEN\" 6; \"BLUE\" 7; \"WHITE\" 8; }", H5LT_DDL))<0)
goto out;
@@ -1457,7 +1457,7 @@ static int test_variables(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for variable types");
+ HL_TESTING3(" text for variable types");
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_NATIVE_CHAR }\n", H5LT_DDL))<0)
goto out;
@@ -1518,7 +1518,7 @@ static int test_arrays(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for array types");
+ HL_TESTING3(" text for array types");
if((dtype = H5LTtext_to_dtype("H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }", H5LT_DDL))<0)
goto out;
@@ -1579,7 +1579,7 @@ static int test_compounds(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for compound types");
+ HL_TESTING3(" text for compound types");
if((dtype = H5LTtext_to_dtype("H5T_COMPOUND { H5T_STD_I16BE \"one_field\" : 2; H5T_STD_U8LE \"two_field\" : 6; }", H5LT_DDL))<0)
goto out;
@@ -1673,7 +1673,7 @@ static int test_compound_bug(void)
" } } \"sub\" : 8;\n"
"}\n";
- TESTING3(" text for compound type of bug fix");
+ HL_TESTING3(" text for compound type of bug fix");
if((dtype = H5LTtext_to_dtype(text, H5LT_DDL))<0)
goto out;
@@ -1765,7 +1765,7 @@ static int test_complicated_compound(void)
size_t size = 1024;
const char *filename = H5_get_srcdir_filename(INPUT_FILE);
- TESTING3(" text for complicated compound types");
+ HL_TESTING3(" text for complicated compound types");
/* Open input file */
fp = HDfopen(filename, "r");
@@ -1834,7 +1834,7 @@ out:
*/
static int test_text_dtype(void)
{
- TESTING("H5LTtext_to_dtype");
+ HL_TESTING2("H5LTtext_to_dtype");
if(test_integers()<0)
goto out;
@@ -1882,7 +1882,7 @@ static int test_valid_path(void)
htri_t path_valid;
const char *data_string_in = "test";
- TESTING("H5LTpath_valid");
+ HL_TESTING2("H5LTpath_valid");
/* Create a new file using default properties. */
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 7003b26..61aebc7 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -178,7 +178,7 @@ static int test_create_close(hid_t fid)
hid_t table;
hid_t part_t;
- TESTING("H5PTcreate_fl and H5PTclose");
+ HL_TESTING2("H5PTcreate_fl and H5PTclose");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -188,11 +188,11 @@ static int test_create_close(hid_t fid)
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
if (H5Tclose(part_t) < 0)
- goto error;
+ goto error;
if( H5PTis_valid(table) < 0)
- goto error;
+ goto error;
if( H5PTis_varlen(table) != 0)
- goto error;
+ goto error;
/* Close the table */
err = H5PTclose(table);
@@ -219,7 +219,7 @@ static int test_open(hid_t fid)
herr_t err;
hid_t table;
- TESTING("H5PTopen");
+ HL_TESTING2("H5PTopen");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -255,7 +255,7 @@ static int test_append(hid_t fid)
hid_t table;
hsize_t count = 0;
- TESTING("H5PTappend");
+ HL_TESTING2("H5PTappend");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -322,7 +322,7 @@ static int test_read(hid_t fid)
particle_t readBuf[NRECORDS];
size_t c;
- TESTING("H5PTread_packets");
+ HL_TESTING2("H5PTread_packets");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -383,7 +383,7 @@ static int test_get_next(hid_t fid)
particle_t readBuf2[NRECORDS];
size_t c;
- TESTING("H5PTget_next");
+ HL_TESTING2("H5PTget_next");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -454,7 +454,7 @@ static int test_big_table(hid_t fid)
particle_t readPart;
hsize_t count;
- TESTING("large packet table");
+ HL_TESTING2("large packet table");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -528,7 +528,7 @@ static int test_opaque(hid_t fid)
size_t c;
particle_t readBuf[NRECORDS];
- TESTING("opaque data");
+ HL_TESTING2("opaque data");
/* Create an opaque datatype for the particle struct */
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
@@ -602,7 +602,7 @@ test_compress(void)
particle_t readPart[1];
hsize_t count;
- TESTING("packet table compression");
+ HL_TESTING2("packet table compression");
/* Create a file. */
if((fid1 = H5Fcreate(TEST_COMPRESS_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
@@ -739,7 +739,7 @@ static int test_rw_nonnative_dt(hid_t fid)
int writeBuffer[5];
int readBuffer[5];
- TESTING("reading/writing non-native packet table");
+ HL_TESTING2("reading/writing non-native packet table");
/* Initialize buffers */
for(x=0; x<5; x++) {
@@ -794,7 +794,7 @@ static int test_rw_nonnative_dt(hid_t fid)
/* Close the packet table */
if( (err = H5PTclose(ptable)) < 0)
goto error;
-
+
PASSED();
return SUCCEED;
@@ -819,7 +819,7 @@ static int test_error(hid_t fid)
int id_open=0;
particle_t readBuf[1];
- TESTING("error conditions");
+ HL_TESTING2("error conditions");
/* Create a HL table */
if(create_hl_table(fid) < 0)
@@ -981,7 +981,7 @@ int main(void)
/* Close the file */
if (H5Fclose(fid) < 0)
- status = 1;
+ status = 1;
return status;
}
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 1d6231e..4d83ae6 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -46,24 +46,24 @@ static int verify_attribute(hid_t fid, const char *table_name, const char *attr_
/*-------------------------------------------------------------------------
* test_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- 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 */
- 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 */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ 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 */
+ 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 */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -71,42 +71,42 @@ static int test_VLof_atomic(void)
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -114,33 +114,33 @@ static int test_VLof_atomic(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- 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]);
- }
+ 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]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -157,7 +157,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -169,18 +169,18 @@ static int test_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- 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 */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ 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 */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -188,7 +188,7 @@ static int test_VLof_comptype(void)
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -199,48 +199,48 @@ static int test_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate(fid, PT_VLEN_COMP, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -248,39 +248,39 @@ static int test_VLof_comptype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
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 */
+ continue;
+ } /* write len != read len */
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 */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -298,8 +298,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -310,23 +310,23 @@ static int test_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file 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 count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file 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 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;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ 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");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -336,15 +336,15 @@ static int test_compound_VL_VLtype(void)
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
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((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -354,58 +354,58 @@ static int test_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -413,7 +413,7 @@ static int test_compound_VL_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -448,19 +448,19 @@ static int test_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -479,27 +479,27 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file 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; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- 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 */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file 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; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ 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 */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -510,12 +510,12 @@ static int test_VLof_VLtype(void)
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1=(hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv * 1;
for (ww = 0; ww < (vv * 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -525,39 +525,39 @@ static int test_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -565,24 +565,24 @@ static int test_VLof_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -600,41 +600,41 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_ptlengthtype() - helper function, verifies that the named packet
- * table is a fixed-length or variable-length as indicated by the last
- * argument.
+ * table is a fixed-length or variable-length as indicated by the last
+ * argument.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value)
{
- hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
herr_t is_varlen = 0;
herr_t ret = FAIL;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
/* Verify the value returned from H5PTis_varlen is as expected */
is_varlen = H5PTis_varlen(ptable);
if (is_varlen == FAIL)
- goto error;
+ goto error;
else if (is_varlen == expected_value)
- ret = SUCCEED;
+ ret = SUCCEED;
else
{
- char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
- if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
- ret = FAIL;
+ char lenthtype[20];
+ HDstrcpy(lenthtype, "fixed-length");
+ if (expected_value == 1)
+ HDstrcpy(lenthtype, "variable-length");
+ fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
+ ret = FAIL;
}
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return ret;
@@ -645,71 +645,71 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_H5PTis_varlen(): Test that H5PTis_varlen works correctly on both
- * fixed- and variable-length packet tables.
+ * fixed- and variable-length packet tables.
*
* Description:
- * - Added a fixed-length packet table to the file for variety
- * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
- * on each packet table.
+ * - Added a fixed-length packet table to the file for variety
+ * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
+ * on each packet table.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_H5PTis_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- herr_t ret; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ herr_t ret; /* Returned status from a callee */
- TESTING("H5PTis_varlen");
+ HL_TESTING2("H5PTis_varlen");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a new table */
ptable = H5PTcreate(fid, PT_FIXED_LEN, H5T_STD_I32BE, (hsize_t)100, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Open each packet table, and verify that H5PTis_varlen returns correct
type for each table */
ret = verify_ptlengthtype(fid, PT_VLEN_ATOMIC, 1); /* vlen of atomic */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_COMP, 1); /* vlen of compound */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_COMP_VLEN, 0); /* compound of vlen, no vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_VLEN, 1); /* vlen of vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_FIXED_LEN, 0); /* no vlen */
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -722,11 +722,11 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* adding_attribute() - helper function, adds an attribute to the named
- * packet table.
+ * packet table.
* Note:
- * For simplicity, the attributes that are added to the packet tables
- * have the same characteristics except their names. They have the
- * same type, space, and values.
+ * For simplicity, the attributes that are added to the packet tables
+ * have the same characteristics except their names. They have the
+ * same type, space, and values.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -737,47 +737,47 @@ int attr_data[ATTR_DIM]={256,11945,-22107}; /* values to be written to attr */
static int adding_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 identifier */
- hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
- int ret = FAIL; /* Returned status from a callee */
+ 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 identifier */
+ hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
+ int 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;
+ goto error;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Add the specified attribute to it */
attr_id = H5Acreate2(dset_id, attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Write attribute values */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, attr_data);
if (ret < 0)
- goto error;
+ goto error;
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the dataspace */
if (H5Sclose(space_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -790,39 +790,39 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_attribute() - helper function, verifies the named attribute can
- * be read correctly.
+ * be read correctly.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
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 attr_id=H5I_INVALID_HID; /* Attribute identifier */
- hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
- int read_data[ATTR_DIM]; /* Output buffer */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
+ int read_data[ATTR_DIM]; /* Output buffer */
int ii;
- herr_t ret = FAIL; /* Returned status from a callee */
+ herr_t ret = FAIL; /* Returned status from a callee */
/* Open the named packet table */
ptable = H5PTopen(fid, table_name);
if (ptable < 0)
- goto error;
+ goto error;
/* Get the dataset id of this packet table */
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Open first attribute for the dataset */
attr_id = H5Aopen(dset_id, attr_name, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Read attribute values */
ret = H5Aread(attr_id, H5T_NATIVE_INT, read_data);
if (ret < 0)
- goto error;
+ goto error;
/* Verify values read in */
for (ii = 0; ii < ATTR_DIM; ii++)
@@ -831,11 +831,11 @@ static herr_t verify_attribute(hid_t fid, const char *table_name, const char *at
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -849,58 +849,58 @@ error: /* An error has occurred. Clean up and exit. */
* test_attributes(): Test adding attributes to packet tables
*
* Description:
- * Added attributes to some random packet tables in the file.
+ * Added attributes to some random packet tables in the file.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_attributes(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("adding attributes to packet tables");
+ HL_TESTING2("adding attributes to packet tables");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Add an arbitrary attribute to a few packet tables, using helper func */
attr_id = adding_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (attr_id < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file again */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Read each attribute and verify the values, using helper function */
ret = verify_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return(ret);
@@ -913,17 +913,17 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_accessors() - helper function, verifies that various info can be
- * retrieved correctly using the info returned by the accessor functions.
+ * retrieved correctly using the info returned by the accessor functions.
*
* Description:
- * Testing functions H5PTget_dataset and H5PTget_type
+ * Testing functions H5PTget_dataset and H5PTget_type
*
- * - Opens the named packet table
- * - Gets its associated dataset ID then calls a C function on that ID
- * to verify the dataset name
- * - Gets its associated datatype ID then calls a C function on that ID
- * to verify that the packet table is variable- or fixed-length as
- * indicated by the expected_value argument
+ * - Opens the named packet table
+ * - Gets its associated dataset ID then calls a C function on that ID
+ * to verify the dataset name
+ * - Gets its associated datatype ID then calls a C function on that ID
+ * to verify that the packet table is variable- or fixed-length as
+ * indicated by the expected_value argument
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -990,18 +990,18 @@ error: /* An error has occurred. Clean up and exit. */
* test_accessors(): Test the accessor functions
*
* Description:
- * Retrieves the dataset and datatype IDs and verifies various info
- * to ensure these IDs are correct.
+ * Retrieves the dataset and datatype IDs and verifies various info
+ * to ensure these IDs are correct.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_accessors(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("accessor functions");
+ HL_TESTING2("accessor functions");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1031,32 +1031,32 @@ error: /* An error has occurred. Clean up and exit. */
} /* test_accessors */
/**************************************************************************
- Test set for deprecated function H5PTcreate_fl
- Each test in this set is the same as the corresponding one in the
- set for H5PTcreate, as of Mar 2016
+ Test set for deprecated function H5PTcreate_fl
+ Each test in this set is the same as the corresponding one in the
+ set for H5PTcreate, as of Mar 2016
**************************************************************************/
/*-------------------------------------------------------------------------
* testfl_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- 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 */
- 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 */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ 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 */
+ 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 */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1064,42 +1064,42 @@ static int testfl_VLof_atomic(void)
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate_fl(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1107,33 +1107,33 @@ static int testfl_VLof_atomic(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- 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]);
- }
+ 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]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1150,7 +1150,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1162,18 +1162,18 @@ static int testfl_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- 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 */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ 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 */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1181,7 +1181,7 @@ static int testfl_VLof_comptype(void)
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -1192,48 +1192,48 @@ static int testfl_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_COMP, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1241,39 +1241,39 @@ static int testfl_VLof_comptype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
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 */
+ continue;
+ } /* write len != read len */
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 */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1291,8 +1291,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1303,23 +1303,23 @@ static int testfl_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file 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 count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file 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 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;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ 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");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1329,15 +1329,15 @@ static int testfl_compound_VL_VLtype(void)
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
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((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int*)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1347,58 +1347,58 @@ static int testfl_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1406,7 +1406,7 @@ static int testfl_compound_VL_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1441,19 +1441,19 @@ static int testfl_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1472,27 +1472,27 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file 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; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- 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 */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file 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; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ 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 */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1503,12 +1503,12 @@ static int testfl_VLof_VLtype(void)
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + 1;
for (ww = 0; ww < (vv + 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1518,39 +1518,39 @@ static int testfl_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1558,24 +1558,24 @@ static int testfl_VLof_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1593,25 +1593,25 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_packet_table_with_varlen(): Invokes individual tests to ensure that
- * packet tables with variable length are created and written correctly
- * without the specific VL PT functionality. (HDFFV-442)
+ * packet tables with variable length are created and written correctly
+ * without the specific VL PT functionality. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
int test_packet_table_with_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
int status = SUCCEED;
/* Create a file using default properties */
fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes");
@@ -1620,46 +1620,46 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (test_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (test_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (test_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_H5PTis_varlen() < 0)
- status = FAIL;
+ status = FAIL;
/* Test adding attributes to packet table */
if (test_attributes() < 0)
- status = FAIL;
+ status = FAIL;
/* Test accessor functions */
if (test_accessors() < 0)
- status = FAIL;
+ status = FAIL;
/**************************************************************************
- Calling test functions for deprecated function H5PTcreate_fl
- Mar 2016, -BMR
+ Calling test functions for deprecated function H5PTcreate_fl
+ Mar 2016, -BMR
**************************************************************************/
/* Create a file using default properties */
fid = H5Fcreate(TESTFL_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
@@ -1668,19 +1668,19 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (testfl_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (testfl_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (testfl_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (testfl_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
return(status);
}
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 0215697..1d6bcec 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -51,8 +51,6 @@
#define NRECORDS 8
#define NRECORDS_ADD 3
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-
/*-------------------------------------------------------------------------
* structure used for all tests, a particle with properties
*-------------------------------------------------------------------------
@@ -117,7 +115,7 @@ typedef struct particle3_t
*-------------------------------------------------------------------------
*/
-/* Push current alignment rule forcing 4-byte alignment boundary
+/* Push current alignment rule forcing 4-byte alignment boundary
* to the internal stack ...
*/
#pragma pack(push,4)
@@ -129,7 +127,7 @@ typedef struct particle3_t
float aty[3];
float rro[2];
} particle4_t;
-/*
+/*
* ... and restore original alignment rules from stack
*/
#pragma pack(pop)
@@ -164,14 +162,14 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
- !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
- rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
+ rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
HDfprintf(stderr,"%s %ld %f %f %d\n",
- wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
+ wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
return 0;
@@ -424,7 +422,7 @@ static int test_table(hid_t fid, int do_write)
sizeof( rbuf[0].lati)
};
- const char *field_names4[NFIELDS+1] =
+ const char *field_names4[NFIELDS+1] =
{ "F1", "F2", "F3", "F4", "F5", "F6"};
hid_t field_type4[NFIELDS+1];
particle4_t fill_data[1] = { {9999999, -9999999, 999999, {999,999,999},{999,999,999}, {999,999}} };
@@ -458,7 +456,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("making table");
+ HL_TESTING2("making table");
if (H5TBmake_table(TITLE,fid,"table1",FIELDS,RECORDS,type_size_mem,
field_names,field_offset,field_type,
@@ -467,7 +465,7 @@ static int test_table(hid_t fid, int do_write)
PASSED();
}
- TESTING2("reading table");
+ HL_TESTING2("reading table");
/*-------------------------------------------------------------------------
* read the table
@@ -497,7 +495,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing records");
+ HL_TESTING2("writing records");
/* create an empty table */
if (H5TBmake_table(TITLE,fid,"table2",FIELDS,RECORDS,type_size_mem,
@@ -540,7 +538,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading records");
+ HL_TESTING2("reading records");
/*-------------------------------------------------------------------------
* read records, start at 0, read 8
@@ -584,7 +582,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("appending records");
+ HL_TESTING2("appending records");
/*-------------------------------------------------------------------------
* append 2 records
@@ -630,7 +628,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("inserting records");
+ HL_TESTING2("inserting records");
/*-------------------------------------------------------------------------
* insert 2 records
@@ -690,7 +688,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting records");
+ HL_TESTING2("deleting records");
/*-------------------------------------------------------------------------
* Create a table
@@ -883,54 +881,54 @@ static int test_table(hid_t fid, int do_write)
/*------------------------------------------------------------------------
* Functions tested:
*
- * H5TBdelete_record -- With differing memory layout from machine memory
+ * H5TBdelete_record -- With differing memory layout from machine memory
* layout. HDFFV-8055
*
*-------------------------------------------------------------------------
*/
if (do_write)
{
- TESTING2("deleting records (differing memory layout)");
+ HL_TESTING2("deleting records (differing memory layout)");
- dims = 3;
- arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 3;
+ arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- dims = 2;
- arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 2;
+ arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- /* Initialize the field field_type */
- field_type4[0] = H5T_NATIVE_UINT32;
- field_type4[1] = H5T_NATIVE_DOUBLE;
- field_type4[2] = H5T_NATIVE_DOUBLE;
- field_type4[3] = arry3_32f;
- field_type4[4] = arry3_32f;
- field_type4[5] = arry2_32f;
+ /* Initialize the field field_type */
+ field_type4[0] = H5T_NATIVE_UINT32;
+ field_type4[1] = H5T_NATIVE_DOUBLE;
+ field_type4[2] = H5T_NATIVE_DOUBLE;
+ field_type4[3] = arry3_32f;
+ field_type4[4] = arry3_32f;
+ field_type4[5] = arry2_32f;
- /* Make the table */
- if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
+ /* Make the table */
+ if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
tbl_size, field_names4, tbl_offset, field_type4,
chunk_size, fill_data, compress, p_data)<0)
- goto out;
- /* Delete records */
- start = 3;
- nrecords = 3;
- if (H5TBdelete_record(fid, "table", start, nrecords)<0)
- goto out;;
- /* Get table info */
- if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
- goto out;
- /* check */
- if( (int)nfields_out != (int)NFIELDS+1)
- goto out;
-
- if( (int)nrecords_out != (int)NRECORDS-3)
- goto out;
-
- /* close type */
- H5Tclose(arry3_32f);
- H5Tclose(arry2_32f);
-
- PASSED();
+ goto out;
+ /* Delete records */
+ start = 3;
+ nrecords = 3;
+ if (H5TBdelete_record(fid, "table", start, nrecords)<0)
+ goto out;;
+ /* Get table info */
+ if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
+ goto out;
+ /* check */
+ if( (int)nfields_out != (int)NFIELDS+1)
+ goto out;
+
+ if( (int)nrecords_out != (int)NRECORDS-3)
+ goto out;
+
+ /* close type */
+ H5Tclose(arry3_32f);
+ H5Tclose(arry2_32f);
+
+ PASSED();
}
/*-------------------------------------------------------------------------
@@ -945,7 +943,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("adding records");
+ HL_TESTING2("adding records");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table4",FIELDS,RECORDS,type_size_mem,
@@ -1005,7 +1003,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("combining tables");
+ HL_TESTING2("combining tables");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table6",FIELDS,RECORDS,type_size_mem,
@@ -1100,7 +1098,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by name");
+ HL_TESTING2("writing fields by name");
/* make an empty table with fill values */
if (H5TBmake_table(TITLE,fid,"table9",FIELDS,RECORDS,type_size_mem,
@@ -1138,10 +1136,10 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
- rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
+ rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,(double)pressure_in[i],position_in[i].lati);
goto out;
@@ -1163,7 +1161,7 @@ static int test_table(hid_t fid, int do_write)
*
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by name");
+ HL_TESTING2("reading fields by name");
/*-------------------------------------------------------------------------
* write and read the "Pressure" field
@@ -1191,7 +1189,7 @@ static int test_table(hid_t fid, int do_write)
if ( H5TBread_fields_name(fid,"table10","DoesNotExist",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out) >=0)
goto out;
-
+
/* read the "Pressure" field */
if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out)<0)
@@ -1263,7 +1261,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1292,7 +1290,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@@ -1311,7 +1309,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by index");
+ HL_TESTING2("writing fields by index");
/* make an empty table */
if (H5TBmake_table(TITLE,fid,"table11",FIELDS,RECORDS,type_size_mem,
@@ -1351,7 +1349,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@@ -1369,7 +1367,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by index");
+ HL_TESTING2("reading fields by index");
if (do_write)
{
@@ -1470,8 +1468,8 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
- goto out;
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ goto out;
}
}
@@ -1501,7 +1499,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
- !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@@ -1520,7 +1518,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("inserting fields");
+ HL_TESTING2("inserting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table13",FIELDS,RECORDS,type_size_mem,
@@ -1544,8 +1542,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
- !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
- !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
+ !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@@ -1563,7 +1561,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting fields");
+ HL_TESTING2("deleting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table14",FIELDS,RECORDS,type_size_mem,
@@ -1585,7 +1583,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
- !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
+ !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}
@@ -1603,7 +1601,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting table info");
+ HL_TESTING2("getting table info");
/* get table info */
if ( H5TBget_table_info (fid, "table1", &rfields, &rrecords ) < 0 )
@@ -1624,7 +1622,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting field info");
+ HL_TESTING2("getting field info");
/* alocate */
names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );