summaryrefslogtreecommitdiffstats
path: root/test/hyperslab.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-09-15 22:13:18 (GMT)
committerGitHub <noreply@github.com>2023-09-15 22:13:18 (GMT)
commit44a00ef876ad3e1922847e93feac57c479217fbe (patch)
tree5e9fc677913a06a71eba1342633f92e93bd07a6c /test/hyperslab.c
parent59a90368cdb696205bdf15040d1a48b4f69af97f (diff)
downloadhdf5-44a00ef876ad3e1922847e93feac57c479217fbe.zip
hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.gz
hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.bz2
Strip HD prefix from string/char C API calls (#3540)
* Strip HD prefix from string/char C API calls * HD(f)(put|get)(s|c) * HDstr* * HDv*printf * HD(s)(print|scan)f * HDperror But NOT: * HDstrcase* * HDvasprintf * HDstrtok_r * HDstrndup As those are not C99 and have portability work-around implementations. They will be handled later. * Fix th5_system.c screwup
Diffstat (limited to 'test/hyperslab.c')
-rw-r--r--test/hyperslab.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c
index e2ca4f1..2777e04 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -148,19 +148,19 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size
if (0 == ny) {
ndims = 1;
ny = nz = 1;
- HDsnprintf(dim, sizeof(dim), "%lu", (unsigned long)nx);
+ snprintf(dim, sizeof(dim), "%lu", (unsigned long)nx);
} /* end if */
else {
ndims = 2;
nz = 1;
- HDsnprintf(dim, sizeof(dim), "%lux%lu", (unsigned long)nx, (unsigned long)ny);
+ snprintf(dim, sizeof(dim), "%lux%lu", (unsigned long)nx, (unsigned long)ny);
} /* end else */
} /* end if */
else {
ndims = 3;
- HDsnprintf(dim, sizeof(dim), "%lux%lux%lu", (unsigned long)nx, (unsigned long)ny, (unsigned long)nz);
+ snprintf(dim, sizeof(dim), "%lux%lux%lu", (unsigned long)nx, (unsigned long)ny, (unsigned long)nz);
} /* end else */
- HDsnprintf(s, sizeof(s), "Testing hyperslab fill %-11s variable hyperslab", dim);
+ snprintf(s, sizeof(s), "Testing hyperslab fill %-11s variable hyperslab", dim);
printf("%-70s", s);
fflush(stdout);
@@ -303,17 +303,17 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_
if (0 == ny) {
ndims = 1;
ny = nz = 1;
- HDsnprintf(dim, sizeof(dim), "%lu", (unsigned long)nx);
+ snprintf(dim, sizeof(dim), "%lu", (unsigned long)nx);
} /* end if */
else {
ndims = 2;
nz = 1;
- HDsnprintf(dim, sizeof(dim), "%lux%lu", (unsigned long)nx, (unsigned long)ny);
+ snprintf(dim, sizeof(dim), "%lux%lu", (unsigned long)nx, (unsigned long)ny);
} /* end else */
} /* end if */
else {
ndims = 3;
- HDsnprintf(dim, sizeof(dim), "%lux%lux%lu", (unsigned long)nx, (unsigned long)ny, (unsigned long)nz);
+ snprintf(dim, sizeof(dim), "%lux%lux%lu", (unsigned long)nx, (unsigned long)ny, (unsigned long)nz);
} /* end else */
switch (mode) {
@@ -346,7 +346,7 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_
HDabort();
} /* end switch */
- HDsnprintf(s, sizeof(s), "Testing hyperslab copy %-11s %s", dim, sub);
+ snprintf(s, sizeof(s), "Testing hyperslab copy %-11s %s", dim, sub);
printf("%-70s", s);
fflush(stdout);
@@ -597,15 +597,15 @@ test_multifill(size_t nx)
s[0] = '\0';
for (i = 0; i < nx; i++) {
if (dst[i].left != 3333333)
- HDsnprintf(s, sizeof(s), "bad dst[%lu].left", (unsigned long)i);
+ snprintf(s, sizeof(s), "bad dst[%lu].left", (unsigned long)i);
else if (!H5_DBL_ABS_EQUAL(dst[i].mid, fill.mid))
/* Check if two DOUBLE values are equal. If their difference
* is smaller than the EPSILON value for double, they are
* considered equal. See the definition in h5test.h.
*/
- HDsnprintf(s, sizeof(s), "bad dst[%lu].mid", (unsigned long)i);
+ snprintf(s, sizeof(s), "bad dst[%lu].mid", (unsigned long)i);
else if (dst[i].right != 4444444)
- HDsnprintf(s, sizeof(s), "bad dst[%lu].right", (unsigned long)i);
+ snprintf(s, sizeof(s), "bad dst[%lu].right", (unsigned long)i);
if (s[0]) {
H5_FAILED();
if (!HDisatty(1)) {
@@ -744,8 +744,7 @@ test_transpose(size_t nx, size_t ny)
char s[256];
hsize_t i, j;
- HDsnprintf(s, sizeof(s), "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
- (unsigned long)ny);
+ snprintf(s, sizeof(s), "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny);
printf("%-70s", s);
fflush(stdout);
@@ -840,8 +839,8 @@ test_sub_super(size_t nx, size_t ny)
hsize_t i, j;
char s[256];
- HDsnprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx),
- (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny);
+ snprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx),
+ (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny);
printf("%-70s", s);
fflush(stdout);
@@ -890,8 +889,8 @@ test_sub_super(size_t nx, size_t ny)
* Test replicating pixels to produce an image twice as large in each
* dimension.
*/
- HDsnprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx,
- (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny));
+ snprintf(s, sizeof(s), "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx,
+ (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny));
printf("%-70s", s);
fflush(stdout);
@@ -917,17 +916,17 @@ test_sub_super(size_t nx, size_t ny)
for (i = 0; i < nx; i++) {
for (j = 0; j < ny; j++) {
if (half[i * ny + j] != twice[4 * i * ny + 2 * j])
- HDsnprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
- (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2);
+ snprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
+ (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2);
else if (half[i * ny + j] != twice[4 * i * ny + 2 * j + 1])
- HDsnprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
- (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2 + 1);
+ snprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
+ (unsigned long)j, (unsigned long)i * 2, (unsigned long)j * 2 + 1);
else if (half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j])
- HDsnprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
- (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2);
+ snprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
+ (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2);
else if (half[i * ny + j] != twice[(2 * i + 1) * 2 * ny + 2 * j + 1])
- HDsnprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
- (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2 + 1);
+ snprintf(s, sizeof(s), "half[%lu][%lu] != twice[%lu][%lu]", (unsigned long)i,
+ (unsigned long)j, (unsigned long)i * 2 + 1, (unsigned long)j * 2 + 1);
if (s[0]) {
H5_FAILED();
if (!HDisatty(1)) {
@@ -982,7 +981,7 @@ test_array_fill(size_t lo, size_t hi)
size_t u, v, w; /* Local index variables */
char s[256];
- HDsnprintf(s, sizeof(s), "array filling %4lu-%-4lu elements", (unsigned long)lo, (unsigned long)hi);
+ snprintf(s, sizeof(s), "array filling %4lu-%-4lu elements", (unsigned long)lo, (unsigned long)hi);
TESTING(s);
/* Initialize */
@@ -1043,8 +1042,8 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
char s[256];
- HDsnprintf(s, sizeof(s), "array offset %4lux%4lux%4lu elements", (unsigned long)z, (unsigned long)y,
- (unsigned long)x);
+ snprintf(s, sizeof(s), "array offset %4lux%4lux%4lu elements", (unsigned long)z, (unsigned long)y,
+ (unsigned long)x);
TESTING(s);
/* Initialize */
@@ -1126,9 +1125,9 @@ main(int argc, char *argv[])
int i;
for (i = 1, size_of_test = 0; i < argc; i++) {
- if (!HDstrcmp(argv[i], "small"))
+ if (!strcmp(argv[i], "small"))
size_of_test |= TEST_SMALL;
- else if (!HDstrcmp(argv[i], "medium"))
+ else if (!strcmp(argv[i], "medium"))
size_of_test |= TEST_MEDIUM;
else {
printf("unrecognized argument: %s\n", argv[i]);