summaryrefslogtreecommitdiffstats
path: root/test/bittests.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 15:31:32 (GMT)
committerGitHub <noreply@github.com>2023-06-28 15:31:32 (GMT)
commit187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98 (patch)
treebaffa167d0796786241aef6b0ce76d4adec3b66e /test/bittests.c
parent7a44581a84778a1346a2fd5b6cca7d9db905a321 (diff)
downloadhdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.zip
hdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.tar.gz
hdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.tar.bz2
Rename HD(f)printf() to (f)printf() (#3194)
Diffstat (limited to 'test/bittests.c')
-rw-r--r--test/bittests.c242
1 files changed, 121 insertions, 121 deletions
diff --git a/test/bittests.c b/test/bittests.c
index 285f404..13ad749 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -85,13 +85,13 @@ test_find(void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if ((ssize_t)i != n) {
H5_FAILED();
- HDprintf(" Test for set bit %d failed (lsb)!\n", i);
+ printf(" Test for set bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if ((ssize_t)i != n) {
H5_FAILED();
- HDprintf(" Test for set bit %d failed (msb)!\n", i);
+ printf(" Test for set bit %d failed (msb)!\n", i);
goto failed;
}
}
@@ -118,13 +118,13 @@ test_find(void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE);
if ((ssize_t)i != n) {
H5_FAILED();
- HDprintf(" Test for clear bit %d failed (lsb)!\n", i);
+ printf(" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE);
if ((ssize_t)i != n) {
H5_FAILED();
- HDprintf(" Test for clear bit %d failed (lsb)!\n", i);
+ printf(" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
}
@@ -133,10 +133,10 @@ test_find(void)
return 0;
failed:
- HDprintf(" v = 0x");
+ printf(" v = 0x");
for (i = 0; i < (int)sizeof(v1); i++)
- HDprintf("%02x", v1[i]);
- HDprintf("\n");
+ printf("%02x", v1[i]);
+ printf("\n");
return -1;
}
@@ -192,9 +192,9 @@ test_copy(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_LSB, 1);
if (size > 0 && n != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find first copied bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first copied bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -205,9 +205,9 @@ test_copy(void)
n = H5T__bit_find(v2, d_offset, 8 * sizeof(v2) - d_offset, H5T_BIT_LSB, 0);
if (d_offset + size < 8 * sizeof(v2) && n != (ssize_t)size) {
H5_FAILED();
- HDprintf(" Unable to find last copied bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find last copied bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (d_offset + size == 8 * sizeof(v2) && n >= 0) {
@@ -223,9 +223,9 @@ test_copy(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_MSB, 1);
if (size > 0 && (size_t)(n + 1) != d_offset + size) {
H5_FAILED();
- HDprintf(" Unable to find last copied bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last copied bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -236,9 +236,9 @@ test_copy(void)
n = H5T__bit_find(v2, (size_t)0, d_offset + size, H5T_BIT_MSB, 0);
if (d_offset > 0 && n + 1 != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find beginning of copied data "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find beginning of copied data "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == d_offset && n >= 0) {
@@ -252,15 +252,15 @@ test_copy(void)
return 0;
failed:
- HDprintf(" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n", i, (unsigned long)s_offset,
- (unsigned long)d_offset, (unsigned long)size);
- HDprintf(" s = 0x");
+ printf(" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n", i, (unsigned long)s_offset,
+ (unsigned long)d_offset, (unsigned long)size);
+ printf(" s = 0x");
for (j = sizeof(v1) - 1; j >= 0; --j)
- HDprintf("%02x", v1[j]);
- HDprintf("\n d = 0x");
+ printf("%02x", v1[j]);
+ printf("\n d = 0x");
for (j = sizeof(v2) - 1; j >= 0; --j)
- HDprintf("%02x", v2[j]);
- HDprintf("\n");
+ printf("%02x", v2[j]);
+ printf("\n");
return -1;
}
@@ -306,9 +306,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if (n != (ssize_t)offset + shift_dist) {
H5_FAILED();
- HDprintf(" Unable to find first bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -319,9 +319,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n != (ssize_t)(offset + size - 1)) {
H5_FAILED();
- HDprintf(" Unable to find last bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
@@ -335,9 +335,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n != offset) {
H5_FAILED();
- HDprintf(" Unable to find first bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -348,9 +348,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n != (ssize_t)(offset + size) - shift_dist - 1) {
H5_FAILED();
- HDprintf(" Unable to find last bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
@@ -372,9 +372,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if (n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all bits are zero in destination(LSB) "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to verify all bits are zero in destination(LSB) "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -382,9 +382,9 @@ test_shift(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all bits are zero in destination(MSB) "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to verify all bits are zero in destination(MSB) "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
}
@@ -393,11 +393,11 @@ test_shift(void)
return 0;
failed:
- HDprintf(" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n", i, (unsigned long)offset,
- (unsigned long)size, (unsigned long)shift_dist);
+ printf(" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n", i, (unsigned long)offset, (unsigned long)size,
+ (unsigned long)shift_dist);
for (j = sizeof(vector) - 1; j >= 0; --j)
- HDprintf("%02x", vector[j]);
- HDprintf("\n");
+ printf("%02x", vector[j]);
+ printf("\n");
return -1;
}
@@ -445,16 +445,16 @@ test_increment(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if (size != 1 && (size_t)n != offset + size - 1) {
H5_FAILED();
- HDprintf(" Unable to find first bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (size == 1 && n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all-zero bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to verify all-zero bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -465,16 +465,16 @@ test_increment(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (size != 1 && n != (ssize_t)(offset + size - 1)) {
H5_FAILED();
- HDprintf(" Unable to find last bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (size == 1 && n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all-zero bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to verify all-zero bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
}
@@ -483,10 +483,10 @@ test_increment(void)
return 0;
failed:
- HDprintf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
+ printf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
for (j = sizeof(vector) - 1; j >= 0; --j)
- HDprintf("%02x", vector[j]);
- HDprintf("\n");
+ printf("%02x", vector[j]);
+ printf("\n");
return -1;
}
@@ -531,9 +531,9 @@ test_decrement(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n != offset) {
H5_FAILED();
- HDprintf(" Unable to find first bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -544,9 +544,9 @@ test_decrement(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n != (ssize_t)(offset + size - 1)) {
H5_FAILED();
- HDprintf(" Unable to find last bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
}
@@ -555,10 +555,10 @@ test_decrement(void)
return 0;
failed:
- HDprintf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
+ printf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
for (j = sizeof(vector) - 1; j >= 0; --j)
- HDprintf("%02x", vector[j]);
- HDprintf("\n");
+ printf("%02x", vector[j]);
+ printf("\n");
return -1;
}
@@ -603,9 +603,9 @@ test_negate(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n != offset) {
H5_FAILED();
- HDprintf(" Unable to find first bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -616,9 +616,9 @@ test_negate(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n != (ssize_t)(offset + size - 1)) {
H5_FAILED();
- HDprintf(" Unable to find last bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
@@ -633,9 +633,9 @@ test_negate(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_LSB, 1);
if (n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all-zero bits in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to verify all-zero bits in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
@@ -646,9 +646,9 @@ test_negate(void)
n = H5T__bit_find(vector, (size_t)0, 8 * sizeof(vector), H5T_BIT_MSB, 1);
if (n >= 0) {
H5_FAILED();
- HDprintf(" Unable to verify all-zero bits in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to verify all-zero bits in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
}
@@ -657,10 +657,10 @@ test_negate(void)
return 0;
failed:
- HDprintf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
+ printf(" i=%d, offset=%lu, size=%lu\n", i, (unsigned long)offset, (unsigned long)size);
for (j = sizeof(vector) - 1; j >= 0; --j)
- HDprintf("%02x", vector[j]);
- HDprintf("\n");
+ printf("%02x", vector[j]);
+ printf("\n");
return -1;
}
@@ -714,9 +714,9 @@ test_set(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_LSB, 1);
if (size > 0 && n != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find first set bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first set bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -727,9 +727,9 @@ test_set(void)
n = H5T__bit_find(v2, d_offset, 8 * sizeof(v2) - d_offset, H5T_BIT_LSB, 0);
if (d_offset + size < 8 * sizeof(v2) && n != (ssize_t)size) {
H5_FAILED();
- HDprintf(" Unable to find last set bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find last set bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (d_offset + size == 8 * sizeof(v2) && n >= 0) {
@@ -745,9 +745,9 @@ test_set(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_MSB, 1);
if (size > 0 && (size_t)(n + 1) != d_offset + size) {
H5_FAILED();
- HDprintf(" Unable to find last set bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last set bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -758,9 +758,9 @@ test_set(void)
n = H5T__bit_find(v2, (size_t)0, d_offset + size, H5T_BIT_MSB, 0);
if (d_offset > 0 && n + 1 != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find beginning of set bit region "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find beginning of set bit region "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == d_offset && n >= 0) {
@@ -774,11 +774,11 @@ test_set(void)
return 0;
failed:
- HDprintf(" i=%d, d_offset=%lu, size=%lu\n", i, (unsigned long)d_offset, (unsigned long)size);
- HDprintf(" d = 0x");
+ printf(" i=%d, d_offset=%lu, size=%lu\n", i, (unsigned long)d_offset, (unsigned long)size);
+ printf(" d = 0x");
for (j = sizeof(v2) - 1; j >= 0; --j)
- HDprintf("%02x", v2[j]);
- HDprintf("\n");
+ printf("%02x", v2[j]);
+ printf("\n");
return -1;
}
@@ -832,9 +832,9 @@ test_clear(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_LSB, 0);
if (size > 0 && n != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find first cleared bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find first cleared bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -845,9 +845,9 @@ test_clear(void)
n = H5T__bit_find(v2, d_offset, 8 * sizeof(v2) - d_offset, H5T_BIT_LSB, 1);
if (d_offset + size < 8 * sizeof(v2) && n != (ssize_t)size) {
H5_FAILED();
- HDprintf(" Unable to find last cleared bit in destination "
- "(n=%d)\n",
- (int)n);
+ printf(" Unable to find last cleared bit in destination "
+ "(n=%d)\n",
+ (int)n);
goto failed;
}
if (d_offset + size == 8 * sizeof(v2) && n >= 0) {
@@ -863,9 +863,9 @@ test_clear(void)
n = H5T__bit_find(v2, (size_t)0, 8 * sizeof(v2), H5T_BIT_MSB, 0);
if (size > 0 && (size_t)(n + 1) != d_offset + size) {
H5_FAILED();
- HDprintf(" Unable to find last cleared bit in destination "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find last cleared bit in destination "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == size && n >= 0) {
@@ -876,9 +876,9 @@ test_clear(void)
n = H5T__bit_find(v2, (size_t)0, d_offset + size, H5T_BIT_MSB, 1);
if (d_offset > 0 && n + 1 != (ssize_t)d_offset) {
H5_FAILED();
- HDprintf(" Unable to find beginning of cleared bit region "
- "(reverse, n=%d)\n",
- (int)n);
+ printf(" Unable to find beginning of cleared bit region "
+ "(reverse, n=%d)\n",
+ (int)n);
goto failed;
}
if (0 == d_offset && n >= 0) {
@@ -892,11 +892,11 @@ test_clear(void)
return 0;
failed:
- HDprintf(" i=%d, d_offset=%lu, size=%lu\n", i, (unsigned long)d_offset, (unsigned long)size);
- HDprintf(" d = 0x");
+ printf(" i=%d, d_offset=%lu, size=%lu\n", i, (unsigned long)d_offset, (unsigned long)size);
+ printf(" d = 0x");
for (j = sizeof(v2) - 1; j >= 0; --j)
- HDprintf("%02x", v2[j]);
- HDprintf("\n");
+ printf("%02x", v2[j]);
+ printf("\n");
return -1;
}
@@ -932,10 +932,10 @@ main(void)
nerrors += test_negate() < 0 ? 1 : 0;
if (nerrors) {
- HDprintf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
}
- HDprintf("All bit tests passed.\n");
+ printf("All bit tests passed.\n");
H5close();