summaryrefslogtreecommitdiffstats
path: root/hl/test/test_ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/test/test_ds.c')
-rw-r--r--hl/test/test_ds.c136
1 files changed, 68 insertions, 68 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index d7af9e9..79e6f45 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1049,7 +1049,7 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
- printf(" scale not attached ");
+ HDprintf(" scale not attached ");
}
}
}
@@ -1146,21 +1146,21 @@ 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;
/* make datasets; they are three dimensional*/
for (i=0; i < 2; i++) {
- sprintf(dname,"D%d", i);
+ HDsprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 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;
@@ -2255,7 +2255,7 @@ static int test_simple(void)
char snames[3];
int i, j;
- printf("Testing API functions\n");
+ HDprintf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -2426,7 +2426,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scales ");
+ HL_TESTING2("detach scales ");
/*-------------------------------------------------------------------------
@@ -2919,7 +2919,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
+ HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, DIM0) < 0)
@@ -2942,7 +2942,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
- sprintf(sname,"ds_%d",j);
+ HDsprintf(sname,"ds_%d",j);
if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,DIM0) < 0)
@@ -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");
/*-------------------------------------------------------------------------
@@ -3740,7 +3740,7 @@ static int test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9,3};
- printf("Testing error conditions\n");
+ HDprintf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -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)
@@ -4119,7 +4119,7 @@ static int test_iterators(void)
char dname[30]; /* dataset name */
int i;
- printf("Testing iterators\n");
+ HDprintf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -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)
@@ -4198,7 +4198,7 @@ static int test_iterators(void)
for(i=0; i<100; i++) {
/* make a DS */
- sprintf(dname,"ds_%d",i);
+ HDsprintf(dname,"ds_%d",i);
if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
goto out;
/* open */
@@ -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;
@@ -4311,7 +4311,7 @@ static int test_rank(void)
float buff[1]={1};
int i;
- printf("Testing ranks\n");
+ HDprintf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -4343,13 +4343,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach");
+ HL_TESTING2("attach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
@@ -4371,13 +4371,13 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach");
+ HL_TESTING2("detach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
@@ -4397,13 +4397,13 @@ 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;
for(i=0; i<3; i++) {
- sprintf(name,"ds_a_%d",i);
+ HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,name) < 0)
@@ -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)
@@ -4517,7 +4517,7 @@ static int test_types(void)
const char *s1_str = "ABC";
const char *s2_str = "ABCD";
- printf("Testing scales with several datatypes\n");
+ HDprintf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -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)
@@ -4694,7 +4694,7 @@ static int test_data(void)
float fill=-99; /* fill value */
- printf("Testing reading ASCII data and generate HDF5 data with scales\n");
+ HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -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
@@ -4870,18 +4870,18 @@ static int read_data( const char* fname,
/* read first data file */
f = HDfopen(data_file, "r");
if( f == NULL ) {
- printf( "Could not open file %s\n", data_file );
+ HDprintf( "Could not open file %s\n", data_file );
return -1;
}
for(i=0, nelms=1; i < ndims; i++) {
if(fscanf( f, "%s %u", str, &j) && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
if(fscanf( f, "%d",&n ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
@@ -4892,14 +4892,14 @@ static int read_data( const char* fname,
*buf = (float*) HDmalloc (nelms * sizeof( float ));
if ( *buf == NULL ) {
- printf( "memory allocation failed\n" );
+ HDprintf( "memory allocation failed\n" );
HDfclose(f);
return -1;
}
for(j = 0; j < nelms; j++) {
if(fscanf( f, "%f",&val ) < 0 && HDferror(f)) {
- printf( "fscanf error in file %s\n", data_file );
+ HDprintf( "fscanf error in file %s\n", data_file );
HDfclose(f);
return -1;
} /* end if */
@@ -4930,7 +4930,7 @@ static int test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
- printf("Testing parameter errors\n");
+ HDprintf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, 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;