diff options
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 176 |
1 files changed, 85 insertions, 91 deletions
diff --git a/test/tattr.c b/test/tattr.c index 6edbc69..53e0e43 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -897,8 +897,8 @@ test_attr_compound_read(hid_t fapl) for(i = 0; i < ATTR4_DIM1; i++) for(j = 0; j < ATTR4_DIM2; j++) if(HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) { - printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); - printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); + HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); + HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); } /* end if */ @@ -1035,7 +1035,7 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ @@ -1675,7 +1675,6 @@ test_attr_dtype_shared(hid_t fapl) if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - /* Re-open file */ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); CHECK(file_id, FAIL, "H5Fopen"); @@ -2082,7 +2081,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) /* Re-open all the attributes by name and verify the data */ for(u = 0; u < max_attr; u++) { /* Open attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Aopen(loc_id, attrname, H5P_DEFAULT); CHECK(attr, FAIL, "H5Aopen"); @@ -2106,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) CHECK(attr, FAIL, "H5Aopen_by_idx"); /* Verify Name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name); VERIFY(name_len, HDstrlen(attrname), "H5Aget_name"); if(HDstrcmp(check_name, attrname)) @@ -2205,7 +2204,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2224,7 +2223,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2345,7 +2344,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2368,7 +2367,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) /* Add one more attribute, to push into "dense" storage */ /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2438,7 +2437,6 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); - /* Create file */ if (use_min_dset_oh) { /* using minimized dataset headers */ /* modify fcpl... * sidestep "bug" where file space is lost with minimized dset ohdrs @@ -2502,7 +2500,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -2548,7 +2546,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Delete attributes until the attributes revert to compact storage again */ for(u--; u >= min_dense; u--) { /* Delete attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2562,7 +2560,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); /* Delete one more attribute, which should cause reversion to compact storage */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2575,7 +2573,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "test_attr_dense_verify"); /* Delete another attribute, to verify deletion in compact storage */ - sprintf(attrname, "attr %02u", (u - 1)); + HDsprintf(attrname, "attr %02u", (u - 1)); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -2635,7 +2633,6 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); - /* Create file */ if (use_min_dset_oh) { /* using minimized dataset headers */ /* modify fcpl... * sidestep "bug" where file space is lost with minimized dset ohdrs @@ -2699,7 +2696,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, H5I_INVALID_HID, "H5Acreate2"); @@ -2712,7 +2709,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Rename attribute */ - sprintf(new_attrname, "new attr %02u", u); + HDsprintf(new_attrname, "new attr %02u", u); /* Rename attribute */ ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT); @@ -2766,7 +2763,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) unsigned value; /* Attribute value */ /* Open attribute */ - sprintf(attrname, "new attr %02u", u); + HDsprintf(attrname, "new attr %02u", u); attr = H5Aopen(dataset, attrname, H5P_DEFAULT); CHECK(attr, H5I_INVALID_HID, "H5Aopen"); @@ -2827,7 +2824,6 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); - /* Create file */ if (use_min_dset_oh) { /* using minimized dataset headers */ /* modify fcpl... * sidestep "bug" where file space is lost with minimized dset ohdrs @@ -2842,11 +2838,9 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) if (use_min_dset_oh) CHECK(H5Pclose(fcpl), FAIL, "H5Pclose"); - /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Get size of file */ empty_filesize = h5_get_file_size(FILENAME, fapl); if(empty_filesize < 0) TestErrPrintf("Line %d: file size wrong!\n", __LINE__); @@ -2887,7 +2881,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) /* Add attributes, until well into dense storage */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3031,7 +3025,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3052,7 +3046,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3084,7 +3078,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3192,7 +3186,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3215,7 +3209,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(sid2, FAIL, "H5Screate_simple"); /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3503,7 +3497,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Delete a few attributes until the storage switches to compact */ for(u = min_dense-1; u <= max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); add_attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(add_attr, FAIL, "H5Acreate2"); @@ -3573,7 +3567,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) /* Add attributes, until just before converting to dense storage */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(gid1, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3740,7 +3734,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3759,7 +3753,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3778,7 +3772,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 2; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); if(low == H5F_LIBVER_LATEST) { CHECK(attr, FAIL, "H5Acreate2"); @@ -3802,7 +3796,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Create attribute */ u = 3; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, big_sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -3825,7 +3819,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 1; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3840,7 +3834,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 3; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3855,7 +3849,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 2; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -3870,7 +3864,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -4280,7 +4274,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create many attributes */ for(u = 0; u < nattr; u++) { - sprintf(attrname, "a-%06u", u); + HDsprintf(attrname, "a-%06u", u); exists = H5Aexists(gid, attrname); VERIFY(exists, FALSE, "H5Aexists"); @@ -4333,7 +4327,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) for(u = 0; u < nattr; u++) { unsigned value; /* Attribute value */ - sprintf(attrname, "a-%06u", u); + HDsprintf(attrname, "a-%06u", u); exists = H5Aexists(gid, attrname); VERIFY(exists, TRUE, "H5Aexists"); @@ -4583,7 +4577,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4673,7 +4667,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) H5A_info_t ainfo; /* Attribute information */ /* Retrieve information for attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_name"); @@ -4788,7 +4782,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4811,7 +4805,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) } /* end for */ /* Create another attribute, to push into dense storage */ - sprintf(attrname, "attr %02u", max_compact); + HDsprintf(attrname, "attr %02u", max_compact); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -4905,7 +4899,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) H5A_info_t ainfo; /* Attribute information */ /* Retrieve information for attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Aget_info_by_name(my_dataset, ".", attrname, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_name"); @@ -5181,7 +5175,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Create several attributes, but keep storage in compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5204,7 +5198,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Create another attribute, to push into dense storage */ - sprintf(attrname, "attr %02u", max_compact); + HDsprintf(attrname, "attr %02u", max_compact); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5232,7 +5226,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5252,7 +5246,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ - sprintf(attrname, "attr %02u", (min_dense - 1)); + HDsprintf(attrname, "attr %02u", (min_dense - 1)); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5268,7 +5262,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Re-add attributes to get back into dense form */ for(u = (min_dense - 1); u < (max_compact + 1); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5356,7 +5350,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5376,7 +5370,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) } /* end for */ /* Delete another attribute, to push attribute storage into compact form */ - sprintf(attrname, "attr %02u", (min_dense - 1)); + HDsprintf(attrname, "attr %02u", (min_dense - 1)); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); @@ -5392,7 +5386,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Re-add attributes to get back into dense form */ for(u = (min_dense - 1); u < (max_compact + 1); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5421,11 +5415,11 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete all attributes */ for(u = max_compact; u > 0; u--) { - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); } /* end for */ - sprintf(attrname, "attr %02u", 0); + HDsprintf(attrname, "attr %02u", 0); ret = H5Adelete(my_dataset, attrname); CHECK(ret, FAIL, "H5Adelete"); } /* end for */ @@ -5567,7 +5561,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) /* Create attributes, until attribute storage is in dense form */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5908,7 +5902,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -5945,7 +5939,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6151,7 +6145,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6223,9 +6217,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", (u + 1)); + HDsprintf(attrname, "attr %02u", (u + 1)); else - sprintf(attrname, "attr %02u", (max_compact - (u + 2))); + HDsprintf(attrname, "attr %02u", (max_compact - (u + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6261,7 +6255,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6348,9 +6342,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", (u + 1)); + HDsprintf(attrname, "attr %02u", (u + 1)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - (u + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6394,7 +6388,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, to push into dense form */ for(u = 0; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -6459,9 +6453,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", ((u * 2) + 1)); + HDsprintf(attrname, "attr %02u", ((u * 2) + 1)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6508,9 +6502,9 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); if(order == H5_ITER_INC) - sprintf(attrname, "attr %02u", ((u * 2) + 3)); + HDsprintf(attrname, "attr %02u", ((u * 2) + 3)); else - sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4))); + HDsprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4))); ret = HDstrcmp(attrname, tmpname); VERIFY(ret, 0, "H5Aget_name_by_idx"); } /* end for */ @@ -6600,7 +6594,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end if */ /* Verify name of link */ - sprintf(attrname, "attr %02u", (unsigned)my_info.corder); + HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder); if(HDstrcmp(attr_name, attrname)) return(H5_ITER_ERROR); @@ -7114,7 +7108,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7184,7 +7178,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7465,7 +7459,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7523,7 +7517,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7628,7 +7622,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, /* Open each attribute on object by index and check that it's the correct one */ for(u = 0; u < max_attrs; u++) { /* Open the attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr_id = H5Aopen(obj_id, attrname, H5P_DEFAULT); CHECK(attr_id, FAIL, "H5Aopen"); @@ -7798,7 +7792,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -7865,7 +7859,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate2"); @@ -8047,7 +8041,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create attributes, up to limit of compact form */ for(u = 0; u < max_compact; u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate_by_name"); @@ -8104,7 +8098,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Create more attributes, to push into dense form */ for(u = max_compact; u < (max_compact * 2); u++) { /* Create attribute */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); attr = H5Acreate_by_name(fid, dsetname, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate_by_name"); @@ -8328,7 +8322,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -8664,7 +8658,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -8771,7 +8765,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Create new attribute name */ - sprintf(attrname2, "new attr %02u", u); + HDsprintf(attrname2, "new attr %02u", u); /* Change second dataset's attribute's name */ ret = H5Arename_by_name(fid, DSET2_NAME, attrname, attrname2, H5P_DEFAULT); @@ -9115,7 +9109,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -9225,7 +9219,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Delete attributes from second dataset */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Delete second dataset's attribute */ ret = H5Adelete_by_name(fid, DSET2_NAME, attrname, H5P_DEFAULT); @@ -9489,7 +9483,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Add attributes to each dataset, until after converting to dense storage */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Alternate between creating "small" & "big" attributes */ if(u % 2) { @@ -9616,7 +9610,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Check ref count on attributes of first dataset */ for(u = 0; u < max_compact * 2; u++) { /* Create attribute name */ - sprintf(attrname, "attr %02u", u); + HDsprintf(attrname, "attr %02u", u); /* Open attribute on first dataset */ attr = H5Aopen(dataset, attrname, H5P_DEFAULT); @@ -9891,7 +9885,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Create attributes on group */ for (i=0; i<BUG2_NATTR; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -9901,7 +9895,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Delete every other attribute */ for (i=1; i<BUG2_NATTR; i+=2) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); ret = H5Adelete(gid, aname); CHECK(ret, FAIL, "H5Adelete"); } @@ -9925,7 +9919,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Open an attribute in the middle */ i = (BUG2_NATTR / 4) * 2; - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Aopen(gid, aname, H5P_DEFAULT); CHECK(aid, FAIL, "H5Aopen"); @@ -9968,7 +9962,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Create attributes on group */ for (i=0; i<BUG2_NATTR2; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); aid = H5Acreate2(gid, aname, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -9978,7 +9972,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl) /* Delete every other attribute */ for (i=0; i<BUG2_NATTR2; i++) { - sprintf(aname, "%03u", i); + HDsprintf(aname, "%03u", i); ret = H5Adelete(gid, aname); CHECK(ret, FAIL, "H5Adelete"); } |