diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-08-28 18:32:01 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-08-28 18:32:01 (GMT) |
commit | d8ec4df92880d98907b12af8fc9fff86e0631270 (patch) | |
tree | c2ed10db6ddf23bc4f366260cdf5cf7663ae47be /hl | |
parent | ebc3d3eda5b9e5c3090322e19898e47141efeadd (diff) | |
download | hdf5-d8ec4df92880d98907b12af8fc9fff86e0631270.zip hdf5-d8ec4df92880d98907b12af8fc9fff86e0631270.tar.gz hdf5-d8ec4df92880d98907b12af8fc9fff86e0631270.tar.bz2 |
Update system commands with HD prefix and whitespace
Diffstat (limited to 'hl')
-rw-r--r-- | hl/src/H5DS.c | 106 | ||||
-rw-r--r-- | hl/test/test_ds.c | 112 | ||||
-rw-r--r-- | hl/test/test_lite.c | 86 |
3 files changed, 152 insertions, 152 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index d86cc98..067992f 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -241,7 +241,7 @@ herr_t H5DSattach_scale(hid_t did, if (has_dimlist == 0) { - dims[0] = (hsize_t)rank; + dims[0] = (hsize_t)rank; /* space for the attribute */ if((sid = H5Screate_simple(1, dims, NULL)) < 0) @@ -556,9 +556,9 @@ out: * * Date: December 20, 2004 * -* Comments: +* Comments: * -* Modifications: Function didn't delete DIMENSION_LIST attribute, when +* Modifications: Function didn't delete DIMENSION_LIST attribute, when * all dimension scales were detached from a dataset; added. * 2010/05/13 EIP * @@ -706,24 +706,24 @@ herr_t H5DSdetach_scale(hid_t did, /* same object, reset */ if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr) { - /* If there are more than one reference in the VL element + /* If there are more than one reference in the VL element and the reference we found is not the last one, copy the last one to replace the found one since the order - of the references doesn't matter according to the spec; - reduce the size of the VL element by 1; - if the length of the element becomes 0, free the pointer + of the references doesn't matter according to the spec; + reduce the size of the VL element by 1; + if the length of the element becomes 0, free the pointer and reset to NULL */ size_t len = buf[idx].len; - if(j < len - 1) - ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1]; + if(j < len - 1) + ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1]; len = --buf[idx].len; if(len == 0) { - HDfree(buf[idx].p); + HDfree(buf[idx].p); buf[idx].p = NULL; } - /* Since a reference to a dim. scale can be inserted only once, + /* Since a reference to a dim. scale can be inserted only once, we do not need to continue the search if it is found */ found_ds = 1; break; @@ -736,16 +736,16 @@ herr_t H5DSdetach_scale(hid_t did, goto out; /* Write the attribute, but check first, if we have any scales left, - because if not, we should delete the attribute according to the spec */ + because if not, we should delete the attribute according to the spec */ for(i = 0; i < rank; i++) { if(buf[i].len > 0) { have_ds = 1; - break; + break; } } - if(have_ds) { + if(have_ds) { if(H5Awrite(aid, tid, buf) < 0) - goto out; + goto out; } else { if(H5Adelete(did, DIMENSION_LIST) < 0) @@ -1123,7 +1123,7 @@ htri_t H5DSis_attached(hid_t did, if (dsbuf == NULL) goto out; - if (H5Aread(aid,ntid,dsbuf) < 0) + if (H5Aread(aid,ntid,dsbuf) < 0) goto out; /*------------------------------------------------------------------------- @@ -1445,7 +1445,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) if (H5I_DATASET != it) return FAIL; - if (label == NULL) + if (label == NULL) return FAIL; /* get dataset space */ @@ -1502,7 +1502,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; for (i = 0; i < (unsigned int) rank; i++) - u.const_buf[i] = NULL; + u.const_buf[i] = NULL; /* store the label information in the required index */ u.const_buf[idx] = label; @@ -1532,7 +1532,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) else { - + if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0) goto out; @@ -1541,7 +1541,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) /* allocate and initialize */ u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *)); - + if (u.buf == NULL) goto out; @@ -1626,7 +1626,7 @@ out: * Comments: * * Modifications: -* JIRA HDFFV-7673: Added a check to see if the label name exists, +* JIRA HDFFV-7673: Added a check to see if the label name exists, * if not then returns zero. July 30, 2011. MSB * *------------------------------------------------------------------------- @@ -1714,26 +1714,26 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) if (buf[idx] != NULL) { /* get the real string length */ - nbytes = strlen(buf[idx]); + nbytes = HDstrlen(buf[idx]); - /* compute the string length which will fit into the user's buffer */ - copy_len = MIN(size-1, nbytes); + /* compute the string length which will fit into the user's buffer */ + copy_len = MIN(size-1, nbytes); - /* copy all/some of the name */ - if (label) - { - memcpy(label, buf[idx], copy_len); - - /* terminate the string */ - label[copy_len] = '\0'; - } + /* copy all/some of the name */ + if (label) + { + HDmemcpy(label, buf[idx], copy_len); + + /* terminate the string */ + label[copy_len] = '\0'; + } } /* free all the ptr's from the H5Aread() */ for (i = 0; i < rank; i++) { if (buf[i]) - HDfree(buf[i]); + HDfree(buf[i]); } /* close */ @@ -1867,7 +1867,7 @@ ssize_t H5DSget_scale_name(hid_t did, /* copy all/some of the name */ if (name) { - memcpy(name, buf, copy_len); + HDmemcpy(name, buf, copy_len); /* terminate the string */ name[copy_len]='\0'; @@ -1951,33 +1951,33 @@ htri_t H5DSis_scale(hid_t did) if((tid = H5Aget_type(aid)) < 0) goto out; - /* check to make sure attribute is a string */ - if(H5T_STRING != H5Tget_class(tid)) - goto out; + /* check to make sure attribute is a string */ + if(H5T_STRING != H5Tget_class(tid)) + goto out; - /* check to make sure string is null-terminated */ - if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) - goto out; + /* check to make sure string is null-terminated */ + if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) + goto out; - /* allocate buffer large enough to hold string */ - if((storage_size = H5Aget_storage_size(aid)) == 0) - goto out; + /* allocate buffer large enough to hold string */ + if((storage_size = H5Aget_storage_size(aid)) == 0) + goto out; - buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); - if(buf == NULL) - goto out; + buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); + if(buf == NULL) + goto out; - /* Read the attribute */ + /* Read the attribute */ if(H5Aread(aid, tid, buf) < 0) - goto out; + goto out; - /* compare strings */ + /* compare strings */ if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) is_ds = 1; else is_ds = 0; - HDfree(buf); + HDfree(buf); if(H5Tclose(tid) < 0) goto out; @@ -2236,8 +2236,8 @@ out: static hid_t H5DS_get_REFLIST_type(void) { - hid_t ntid_t = -1; - + hid_t ntid_t = -1; + /* Build native type that corresponds to compound datatype used to store ds_list_t structure in the REFERENCE_LIST attribute */ @@ -2257,5 +2257,5 @@ out: H5Tclose(ntid_t); } H5E_END_TRY; return FAIL; -} +} diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 49dc72f..95178fc 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -186,11 +186,11 @@ int main(void) if(nerrors) goto error; - printf("All dimension scales tests passed.\n"); + HDprintf("All dimension scales tests passed.\n"); return 0; error: - printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S"); + HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S"); return 1; } @@ -1110,7 +1110,7 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); + name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); if(name_out != NULL) { if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) { if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) { @@ -1156,7 +1156,7 @@ static int test_detachscales(void) sprintf(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++) { @@ -1164,11 +1164,11 @@ static int test_detachscales(void) if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0) goto out; } - /* attach scales to the first dataset; first dimension will have + /* attach scales to the first dataset; first dimension will have two scales attached */ if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i=0; i<4; i++) { - sprintf(dname, "DS%d", i); + HDsprintf(dname, "DS%d", i); if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if(H5DSattach_scale(did, dsid, (unsigned int) i%3) < 0) @@ -1185,7 +1185,7 @@ static int test_detachscales(void) /* attach scales to the second dataset */ if((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) { for (i=0; i<3; i++) { - sprintf(dname, "DS%d", i); + HDsprintf(dname, "DS%d", i); if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if(H5DSattach_scale(did, dsid, (unsigned int) i) < 0) @@ -1206,20 +1206,20 @@ static int test_detachscales(void) goto out; for (i=0; i<2; i++) { - sprintf(dname, "D%d", i); + HDsprintf(dname, "D%d", i); if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if(H5DSdetach_scale(did, dsid, (unsigned int)0) < 0) goto out; if(H5Dclose(did) < 0) goto out; - } + } /* Check that attribute "REFERENCE_LIST" doesn't exist anymore */ if(H5Aexists(dsid, REFERENCE_LIST)!= 0) goto out; if(H5Dclose(dsid) < 0) goto out; - /* Check that DS3 is the only dim. scale attached to the first + /* Check that DS3 is the only dim. scale attached to the first dimension of D0 */ if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) < 0) goto out; @@ -1232,11 +1232,11 @@ static int test_detachscales(void) if(H5Dclose(dsid) < 0) goto out; - /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make + /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make sure that attribute "DIMENSION_LIST" doesn't exist anymore */ if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) { for (i=1; i<4; i++) { - sprintf(dname, "DS%d", i); + HDsprintf(dname, "DS%d", i); if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) goto out; if(H5DSdetach_scale(did, dsid, (unsigned int) i%3) < 0) @@ -1253,7 +1253,7 @@ static int test_detachscales(void) else goto out; - + PASSED(); H5Fclose(fid); @@ -2873,10 +2873,10 @@ static int test_simple(void) if((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto out; for(i = 0; i < 5; i++) { - sprintf(dname,"dset_%d",i); + HDsprintf(dname,"dset_%d",i); if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - sprintf(sname,"ds_%d",i); + HDsprintf(sname,"ds_%d",i); if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5DSset_scale(dsid,"scale") < 0) @@ -2893,11 +2893,11 @@ static int test_simple(void) */ for(i = 0; i < 5; i++) { - sprintf(dname, "dset_%d", i); + HDsprintf(dname, "dset_%d", i); 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) @@ -2915,7 +2915,7 @@ static int test_simple(void) */ for(i = 0; i < 5; i++) { - sprintf(dname, "dset_%d", i); + HDsprintf(dname, "dset_%d", i); if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0) goto out; for(j = 0; j < 5; j++) { @@ -2938,7 +2938,7 @@ static int test_simple(void) */ for(i=0; i<5; i++) { - sprintf(dname,"dset_%d",i); + HDsprintf(dname,"dset_%d",i); if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0) goto out; for(j=0; j<5; j++) { @@ -3541,7 +3541,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor for(i=0; i<nelmts; i++) { if(buf[i] != data[i]) { - printf("read and write buffers differ\n"); + HDprintf("read and write buffers differ\n"); goto out; } } @@ -5014,7 +5014,7 @@ static int test_errors2(void) goto out; if ((label_len=H5DSget_label(did,0,NULL,0)) < 0) goto out; - if ( label_len != strlen("label") ) + if ( label_len != HDstrlen("label") ) goto out; if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0) goto out; @@ -5134,83 +5134,83 @@ static int test_attach_detach(void) if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - - if((sid = H5Screate_simple(1, dims, dims)) < 0) + + if((sid = H5Screate_simple(1, dims, dims)) < 0) goto out; if((dsid = H5Dcreate2(gid, DS_3_NAME, H5T_IEEE_F32BE, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) goto out; - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) goto out; - if(H5Pclose(dcpl_id) < 0) + if(H5Pclose(dcpl_id) < 0) goto out; - if(H5DSset_scale(dsid, DS_3_NAME) < 0) + if(H5DSset_scale(dsid, DS_3_NAME) < 0) goto out; /* Create a variable that uses this dimension scale. */ - if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) + if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) goto out; if((var1_id = H5Dcreate2(gid, DS_31_NAME, H5T_NATIVE_FLOAT, sid, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) goto out; - if(H5DSattach_scale(var1_id, dsid, 0) < 0) + if(H5DSattach_scale(var1_id, dsid, 0) < 0) goto out; /* Create another variable that uses this dimension scale. */ - if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0) + if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0) goto out; - if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) + if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) goto out; if((var2_id = H5Dcreate2(gid, DS_32_NAME, H5T_NATIVE_FLOAT, sid, - H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0) + H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0) goto out; - if(H5Pclose(dcpl_id) < 0) + if(H5Pclose(dcpl_id) < 0) goto out; - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) goto out; /* Create 3rd variable that uses this dimension scale. */ - if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) + if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto out; - if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0) + if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0) goto out; - if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) + if((sid = H5Screate_simple(DIM1, dims, dims)) < 0) goto out; if((var3_id = H5Dcreate2(gid, DS_33_NAME, H5T_NATIVE_FLOAT, sid, - H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0) + H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0) goto out; - if(H5Pclose(dcpl_id) < 0) + if(H5Pclose(dcpl_id) < 0) goto out; - if(H5Sclose(sid) < 0) + if(H5Sclose(sid) < 0) goto out; - + /* Attached var2 scale */ - if(H5DSattach_scale(var2_id, dsid, 0) < 0) + if(H5DSattach_scale(var2_id, dsid, 0) < 0) goto out; /* Detach the var2 scale */ - if(H5DSdetach_scale(var2_id, dsid, 0) < 0) + if(H5DSdetach_scale(var2_id, dsid, 0) < 0) goto out; /* Check if in correct state of detached and attached */ @@ -5220,7 +5220,7 @@ static int test_attach_detach(void) goto out; /* Detach the var1 scale */ - if(H5DSdetach_scale(var1_id, dsid, 0) < 0) + if(H5DSdetach_scale(var1_id, dsid, 0) < 0) goto out; /* Check if in correct state of detached and attached */ @@ -5231,10 +5231,10 @@ static int test_attach_detach(void) /* Attach the DS again and remove them in the opposite order */ - if(H5DSattach_scale(var1_id, dsid, 0) < 0) + if(H5DSattach_scale(var1_id, dsid, 0) < 0) goto out; - if(H5DSattach_scale(var2_id, dsid, 0) < 0) + if(H5DSattach_scale(var2_id, dsid, 0) < 0) goto out; /* Detach the var1 scale */ @@ -5262,13 +5262,13 @@ static int test_attach_detach(void) * Attach Three DS and remove the middle one first *****************************************************/ - if(H5DSattach_scale(var1_id, dsid, 0) < 0) + if(H5DSattach_scale(var1_id, dsid, 0) < 0) goto out; - if(H5DSattach_scale(var2_id, dsid, 0) < 0) + if(H5DSattach_scale(var2_id, dsid, 0) < 0) goto out; - if(H5DSattach_scale(var3_id, dsid, 0) < 0) + if(H5DSattach_scale(var3_id, dsid, 0) < 0) goto out; @@ -5314,15 +5314,15 @@ static int test_attach_detach(void) *------------------------------------------------------------------------- */ - if(H5Dclose(var1_id) < 0) + if(H5Dclose(var1_id) < 0) goto out; - if(H5Dclose(var2_id) < 0) + if(H5Dclose(var2_id) < 0) goto out; - if(H5Dclose(var3_id) < 0) + if(H5Dclose(var3_id) < 0) goto out; - if(H5Dclose(dsid) < 0) + if(H5Dclose(dsid) < 0) goto out; - if(H5Gclose(gid) < 0) + if(H5Gclose(gid) < 0) goto out; if(H5Fclose(fid) < 0) goto out; diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 763fdb5..51ab72b 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1050,7 +1050,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) HDfree( dims_out ); return -1; } - + for (i = 0; i < rank_out; i++) { if ( dims_out[i] != 5 ) { HDfree( dims_out ); @@ -1152,7 +1152,7 @@ static int test_fps(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { @@ -1228,7 +1228,7 @@ static int test_strings(void) goto out; } if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1260,7 +1260,7 @@ static int test_strings(void) goto out; } if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1270,13 +1270,13 @@ static int test_strings(void) str_len = str_len + 10; if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { HDfree(dt_str); goto out; } if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len-1)) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1292,10 +1292,10 @@ static int test_strings(void) goto out; } /* check the truncated string */ - if(strlen(dt_str) != str_len-1) goto out; - str_len = strlen(dt_str); + if(HDstrlen(dt_str) != str_len-1) goto out; + str_len = HDstrlen(dt_str); if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len)) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1352,7 +1352,7 @@ static int test_opaques(void) goto out; } if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1428,7 +1428,7 @@ static int test_enums(void) } if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1469,16 +1469,16 @@ static int test_variables(void) if(H5Tis_variable_str(dtype)) goto out; - + if(H5Tclose(dtype)<0) goto out; - + if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_VLEN { H5T_STD_I32BE } }", H5LT_DDL))<0) goto out; - + if(H5Tis_variable_str(dtype)) goto out; - + if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) @@ -1488,15 +1488,15 @@ static int test_variables(void) goto out; } if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } HDfree(dt_str); - + if(H5Tclose(dtype)<0) goto out; - + PASSED(); return 0; @@ -1547,7 +1547,7 @@ static int test_arrays(void) goto out; } if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1603,7 +1603,7 @@ static int test_compounds(void) goto out; } if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) { - printf("dt=\n%s\n", dt_str); + HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; } @@ -1637,7 +1637,7 @@ out: } /*------------------------------------------------------------------------- -* subroutine for test_text_dtype(): test_compound_bug(). Test case for +* subroutine for test_text_dtype(): test_compound_bug(). Test case for * issue 7701. *------------------------------------------------------------------------- */ @@ -1770,7 +1770,7 @@ static int test_complicated_compound(void) /* Open input file */ fp = HDfopen(filename, "r"); if(fp == NULL) { - printf( "Could not find file %s. Try set $srcdir \n", filename); + HDprintf( "Could not find file %s. Try set $srcdir \n", filename); goto out; } @@ -1881,9 +1881,9 @@ static int test_valid_path(void) hid_t file_id, group; htri_t path_valid; const char *data_string_in = "test"; - + TESTING("H5LTpath_valid"); - + /* Create a new file using default properties. */ /************************************************************** @@ -1908,11 +1908,11 @@ static int test_valid_path(void) * | * | * | --- Gcyc (soft link to /G1) - * / \ - * / \ - * G5 \ + * / \ + * / \ + * G5 \ * (soft link G6 (external link /G1 in FILENAME4) - * to /G2) + * to /G2) * ****************************************************************/ @@ -1941,7 +1941,7 @@ static int test_valid_path(void) */ if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0) goto out; - + /* * Create a soft link */ @@ -2023,9 +2023,9 @@ static int test_valid_path(void) * | * | * | - * G1 + * G1 * / \ - * / \ + * / \ * DS1 G2 * (dangled soft link to /G1/G20) * @@ -2056,13 +2056,13 @@ static int test_valid_path(void) goto out; H5Fclose(file_id); - + /* Open input file */ if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0) goto out; /************************************** - * CHECK ABSOLUTE PATHS + * CHECK ABSOLUTE PATHS **************************************/ if( (path_valid = H5LTpath_valid(file_id, "/", TRUE)) != TRUE) { @@ -2076,7 +2076,7 @@ static int test_valid_path(void) if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) { goto out; } - + if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE) goto out; @@ -2094,7 +2094,7 @@ static int test_valid_path(void) if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE) goto out; - + if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE) goto out; @@ -2114,14 +2114,14 @@ static int test_valid_path(void) /* check soft links */ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE) goto out; - + /************************************** - * CHECK RELATIVE PATHS + * CHECK RELATIVE PATHS ***************************************/ if( (group = H5Gopen2(file_id, "/", H5P_DEFAULT)) < 0) goto out; - + if( (path_valid = H5LTpath_valid(group, "/", TRUE)) != TRUE) { goto out; } @@ -2156,22 +2156,22 @@ static int test_valid_path(void) goto out; if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE) - goto out; + goto out; /* Check the "./" case */ if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE) goto out; if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE) - goto out; + goto out; /* Should fail, does not exist */ if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE) - goto out; + goto out; /* Should fail, does not exist */ if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE) - goto out; + goto out; if(H5Gclose(group)<0) goto out; @@ -2220,7 +2220,7 @@ static int test_valid_path(void) PASSED(); return 0; - out: + out: H5_FAILED(); return -1; } |