summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2022-04-05 13:20:19 (GMT)
committerGitHub <noreply@github.com>2022-04-05 13:20:19 (GMT)
commitbddd148fd29deb18439767c416199914845431b8 (patch)
tree9afaa591016c2ae1fe1978d4573c80303420d922 /tools/test
parent99ba670f6add3bf83c0361537230e686f3976d1e (diff)
downloadhdf5-bddd148fd29deb18439767c416199914845431b8.zip
hdf5-bddd148fd29deb18439767c416199914845431b8.tar.gz
hdf5-bddd148fd29deb18439767c416199914845431b8.tar.bz2
Misc fixes from develop nov21 - feb22 (#1580)
* Make default to build high-level tools the same as default for (#1234) high-level library. * Updated README.txt to README.md (#1375) * H5Lexists docs: Removed reference to 1.8.16 since the change is the 1.8.x releases, HDFFV-11289 * H5Oget_info_by_name, name can be any object, not just a group * Converted README.txt to README.md and updated files referring to README.txt to README.md. * removed references to README.txt * updated MANIFEST * Snprintf2 (#1399) * Replaced many uses of sprintf with safer snprintf Many very straightforward, but in a few cases added a length parameter to some private functions, because buffer length was otherwise unknowable. * Removed unnecessary use of static on small buffers This improves thread safety. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Replaced several uses of sprintf with safer snprintf (#1383) * Replaced several uses of sprintf with safer snprintf * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Used clang-tidy to change all floating point f suffixes to F (#1359) * Added another missing override keyword on a dtor (#1384) * Creating FUNDING.yml (#1427) * Creating FUNDING.yml Will add sponsor this project widget to the repo's page. * Correct file name Add sponsor widget; filename typo fixed. * Update MANIFEST * Fixed AbstractDs::getVarLenType documentation (#1441) * Committing clang-format changes * Open bsd fixes (#1195) * Fix end of line alignment. Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: loricooperhdf <lori.cooper@hdfgroup.org> Co-authored-by: myd7349 <myd7349@gmail.com>
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5repack/h5repackgentest.c2
-rw-r--r--tools/test/misc/h5clear_gentest.c4
-rw-r--r--tools/test/perform/direct_write_perf.c2
-rw-r--r--tools/test/perform/perf_meta.c14
4 files changed, 11 insertions, 11 deletions
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index 576b1c7..a22af3d 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -307,7 +307,7 @@ generate_f32le(hbool_t external)
/* Generate values */
for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) {
for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) {
- wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1));
+ wdata[k] = n * 801.1F * ((k % 5 == 1) ? (-1) : (1));
}
}
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 53fbc42..999611a 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -426,7 +426,7 @@ main(void)
if ((my_fapl = H5Pcopy(fapl2)) < 0)
goto error;
/* Create the file */
- HDsprintf(fname, "%s%s", new_format ? "latest_" : "", FILENAME[0]);
+ HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[0]);
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT,
my_fapl)) < 0)
goto error;
@@ -451,7 +451,7 @@ main(void)
goto error;
/* Create the file */
- HDsprintf(fname, "%s%s", new_format ? "latest_" : "", FILENAME[1]);
+ HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[1]);
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT,
my_fapl)) < 0)
goto error;
diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c
index b3ae54d..762cd61 100644
--- a/tools/test/perform/direct_write_perf.c
+++ b/tools/test/perform/direct_write_perf.c
@@ -660,7 +660,7 @@ main(void)
hid_t fapl = H5P_DEFAULT;
int i;
- sprintf(filename, "%s.h5", FILENAME[0]);
+ snprintf(filename, sizeof(filename), "%s.h5", FILENAME[0]);
create_file(fapl);
test_direct_write_uncompressed_data(fapl);
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index d8ed9ec..ad76711 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -304,7 +304,7 @@ create_dsets(hid_t file)
* Create a dataset using the default dataset creation properties.
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
goto error;
@@ -366,14 +366,14 @@ create_attrs_1(void)
* Create all(user specifies the number) attributes for each dataset
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
open_t.start = retrieve_time();
if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for (j = 0; j < NUM_ATTRS; j++) {
- HDsprintf(attr_name, "all attrs for each dset %d", j);
+ HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -468,7 +468,7 @@ create_attrs_2(void)
* Create all(user specifies the number) attributes for each new dataset
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
create_t.start = retrieve_time();
if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -476,7 +476,7 @@ create_attrs_2(void)
perf(&create_t, create_t.start, retrieve_time());
for (j = 0; j < NUM_ATTRS; j++) {
- HDsprintf(attr_name, "all attrs for each dset %d", j);
+ HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -579,14 +579,14 @@ create_attrs_3(void)
for (i = 0; i < loop_num; i++) {
for (j = 0; j < NUM_DSETS; j++) {
- HDsprintf(dset_name, "dataset %d", j);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", j);
open_t.start = retrieve_time();
if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for (k = 0; k < BATCH_ATTRS; k++) {
- HDsprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ HDsnprintf(attr_name, sizeof(attr_name), "some attrs for each dset %d %d", i, k);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)