summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-01-11 01:51:42 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-01-11 01:51:42 (GMT)
commit536a32c59be69f9ae75604a31d0ec34c57cf9f00 (patch)
tree605e0c0272cce05f9b8b8ed1799c384c9894ed0e /test
parenta7e0ef996a63b87cc0295b58f37f037c848a6929 (diff)
downloadhdf5-536a32c59be69f9ae75604a31d0ec34c57cf9f00.zip
hdf5-536a32c59be69f9ae75604a31d0ec34c57cf9f00.tar.gz
hdf5-536a32c59be69f9ae75604a31d0ec34c57cf9f00.tar.bz2
C and POSIX call cleanup
Diffstat (limited to 'test')
-rw-r--r--test/accum.c6
-rw-r--r--test/app_ref.c6
-rw-r--r--test/big.c4
-rw-r--r--test/bittests.c174
-rw-r--r--test/h5test.c12
-rw-r--r--test/mount.c38
-rw-r--r--test/titerate.c8
-rw-r--r--test/tselect.c24
-rw-r--r--test/tsohm.c30
-rw-r--r--test/ttime.c6
-rw-r--r--test/tunicode.c2
-rw-r--r--test/tvlstr.c18
-rw-r--r--test/vds.c8
-rw-r--r--test/vfd.c44
14 files changed, 191 insertions, 189 deletions
diff --git a/test/accum.c b/test/accum.c
index 7af353c..da90995 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -100,7 +100,7 @@ main(void)
/* Test Setup */
- puts("Testing the metadata accumulator");
+ HDputs("Testing the metadata accumulator");
/* File access property list */
h5_reset();
@@ -152,7 +152,7 @@ main(void)
if(nerrors)
goto error;
- puts("All metadata accumulator tests passed.");
+ HDputs("All metadata accumulator tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
@@ -160,7 +160,7 @@ main(void)
error:
if(api_ctx_pushed) H5CX_pop();
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
} /* end main() */
diff --git a/test/app_ref.c b/test/app_ref.c
index 3ef3fef..a4853fa 100644
--- a/test/app_ref.c
+++ b/test/app_ref.c
@@ -83,8 +83,8 @@ Abrt_Handler (int H5_ATTR_UNUSED sig)
int i, n;
for (i=0; i<T_NUMCLASSES; i++) {
- fprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
- fprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
+ HDfprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
+ HDfprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
}
}
@@ -195,7 +195,7 @@ main (void)
error:
- puts("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
+ HDputs("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
return 1;
}
diff --git a/test/big.c b/test/big.c
index fe52aef..b3105eb 100644
--- a/test/big.c
+++ b/test/big.c
@@ -524,7 +524,7 @@ reader(char *filename, hid_t fapl)
}
if(zero) {
H5_FAILED();
- printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
+ HDprintf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
} else if(wrong) {
SKIPPED();
HDputs(" Possible overlap with another region.");
@@ -765,7 +765,7 @@ main (int ac, char **av)
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
}
else{
- printf("***Missing fsize value***\n");
+ HDprintf("***Missing fsize value***\n");
usage();
return 1;
}
diff --git a/test/bittests.c b/test/bittests.c
index ccd725c..e29c188 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -57,13 +57,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (lsb)!");
+ HDputs (" Zero length test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (msb)!");
+ HDputs (" Zero length test failed (msb)!");
goto failed;
}
@@ -73,13 +73,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (lsb)!");
+ HDputs (" Zero buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (msb)!");
+ HDputs (" Zero buffer test failed (msb)!");
goto failed;
}
@@ -90,13 +90,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();
- printf (" Test for set bit %d failed (lsb)!\n", i);
+ HDprintf (" 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();
- printf (" Test for set bit %d failed (msb)!\n", i);
+ HDprintf (" Test for set bit %d failed (msb)!\n", i);
goto failed;
}
}
@@ -106,13 +106,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (lsb)!");
+ HDputs (" One buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (msb)!");
+ HDputs (" One buffer test failed (msb)!");
goto failed;
}
@@ -123,13 +123,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();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" 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();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
}
@@ -139,9 +139,9 @@ test_find (void)
return 0;
failed:
- printf (" v = 0x");
- for (i=0; i<(int)sizeof(v1); i++) printf ("%02x", v1[i]);
- printf ("\n");
+ HDprintf (" v = 0x");
+ for (i=0; i<(int)sizeof(v1); i++) HDprintf ("%02x", v1[i]);
+ HDprintf ("\n");
return -1;
}
@@ -185,12 +185,12 @@ test_copy (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find copied region in destination");
+ HDputs (" Unabled to find copied region in destination");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found copied bits when we shouldn't have");
+ HDputs (" Found copied bits when we shouldn't have");
goto failed;
}
@@ -199,25 +199,25 @@ 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();
- printf (" Unable to find first copied bit in destination "
+ HDprintf (" Unable to find first copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits and shouldn't have!");
+ HDputs (" Found copied bits and shouldn't have!");
goto failed;
}
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();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -228,25 +228,25 @@ 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();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits but shouldn't have (reverse)!");
+ HDputs (" Found copied bits but shouldn't have (reverse)!");
goto failed;
}
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();
- printf (" Unable to find beginning of copied data "
+ HDprintf (" Unable to find beginning of copied data "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading original data but shouldn't have!");
+ HDputs (" Found leading original data but shouldn't have!");
goto failed;
}
@@ -256,14 +256,14 @@ test_copy (void)
return 0;
failed:
- printf (" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n",
+ HDprintf (" 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) printf ("%02x", v1[j]);
- printf ("\n d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" s = 0x");
+ for (j=sizeof(v1)-1; j>=0; --j) HDprintf ("%02x", v1[j]);
+ HDprintf ("\n d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -311,7 +311,7 @@ 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();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -323,7 +323,7 @@ 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();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -338,7 +338,7 @@ 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();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -350,7 +350,7 @@ 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();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -373,7 +373,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(LSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(LSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -382,7 +382,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(MSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(MSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -392,11 +392,11 @@ test_shift (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n",
+ HDprintf (" 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) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -446,13 +446,13 @@ 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();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -464,13 +464,13 @@ 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();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -480,10 +480,10 @@ test_increment (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -530,7 +530,7 @@ 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();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -542,7 +542,7 @@ 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();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -552,10 +552,10 @@ test_decrement (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -602,7 +602,7 @@ 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();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -614,7 +614,7 @@ 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();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -630,7 +630,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -642,7 +642,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -652,10 +652,10 @@ test_negate (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -697,12 +697,12 @@ test_set (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find set region in buffer");
+ HDputs (" Unabled to find set region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found set bits when we shouldn't have");
+ HDputs (" Found set bits when we shouldn't have");
goto failed;
}
@@ -711,25 +711,25 @@ 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();
- printf (" Unable to find first set bit in destination "
+ HDprintf (" Unable to find first set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits and shouldn't have!");
+ HDputs (" Found set bits and shouldn't have!");
goto failed;
}
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();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -740,25 +740,25 @@ 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();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits but shouldn't have (reverse)!");
+ HDputs (" Found set bits but shouldn't have (reverse)!");
goto failed;
}
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();
- printf (" Unable to find beginning of set bit region "
+ HDprintf (" Unable to find beginning of set bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading zeros but shouldn't have!");
+ HDputs (" Found leading zeros but shouldn't have!");
goto failed;
}
@@ -768,11 +768,11 @@ test_set (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" 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) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -814,12 +814,12 @@ test_clear (void)
for (j=0; j<(int)sizeof(v2); j++) if (0xff!=v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find cleared region in buffer");
+ HDputs (" Unabled to find cleared region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found cleared bits when we shouldn't have");
+ HDputs (" Found cleared bits when we shouldn't have");
goto failed;
}
@@ -828,25 +828,25 @@ 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();
- printf (" Unable to find first cleared bit in destination "
+ HDprintf (" Unable to find first cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits and shouldn't have!");
+ HDputs (" Found cleared bits and shouldn't have!");
goto failed;
}
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();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order ones are present and shouldn't be!");
+ HDputs (" High-order ones are present and shouldn't be!");
goto failed;
}
@@ -857,25 +857,25 @@ 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();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits but shouldn't have (reverse)!");
+ HDputs (" Found cleared bits but shouldn't have (reverse)!");
goto failed;
}
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();
- printf (" Unable to find beginning of cleared bit region "
+ HDprintf (" Unable to find beginning of cleared bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading ones but shouldn't have!");
+ HDputs (" Found leading ones but shouldn't have!");
goto failed;
}
@@ -885,11 +885,11 @@ test_clear (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" 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) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -928,11 +928,11 @@ main(void)
nerrors += test_negate() < 0 ? 1 : 0;
if(nerrors) {
- printf("***** %u FAILURE%s! *****\n",
+ HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1 == nerrors ? "" : "S");
exit(EXIT_FAILURE);
}
- printf("All bit tests passed.\n");
+ HDprintf("All bit tests passed.\n");
H5close();
diff --git a/test/h5test.c b/test/h5test.c
index ea5e2f8..d17156a 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1270,7 +1270,7 @@ h5_set_info_object(void)
int ret_value=0;
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
char *next, *valp;
valp = envp = next = HDstrdup(envp);
@@ -1332,7 +1332,7 @@ h5_set_info_object(void)
/* actually set the darned thing */
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
+ HDprintf("MPI_Info_set failed\n");
ret_value = -1;
}
}
@@ -1508,9 +1508,9 @@ print_func(const char *format, ...)
va_list arglist;
int ret_value;
- va_start(arglist, format);
+ HDva_start(arglist, format);
ret_value = vprintf(format, arglist);
- va_end(arglist);
+ HDva_end(arglist);
return ret_value;
}
@@ -1595,7 +1595,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
int len;
static char* env = NULL;
- assert(name);
+ HDassert(name);
MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
@@ -1603,7 +1603,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
- assert(root < mpi_size);
+ HDassert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
diff --git a/test/mount.c b/test/mount.c
index c6230ee..b7d2858 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -192,7 +192,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting a file on itself should have failed.");
+ HDputs(" Mounting a file on itself should have failed.");
TEST_ERROR
} /* end if */
@@ -208,7 +208,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting two files at one mount point should have failed.");
+ HDputs(" Mounting two files at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -227,7 +227,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting same file opened twice at one mount point should have failed.");
+ HDputs(" Mounting same file opened twice at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -240,7 +240,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Creating a cycle with mount points should have failed.");
+ HDputs(" Creating a cycle with mount points should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -423,7 +423,7 @@ test_hide(hid_t fapl)
} H5E_END_TRY;
if(grp >= 0) {
H5_FAILED();
- puts(" Name is still accessible under mount point.");
+ HDputs(" Name is still accessible under mount point.");
TEST_ERROR
} /* end if */
@@ -434,7 +434,7 @@ test_hide(hid_t fapl)
if(H5Oget_info_by_name2(file1, "/file1", &oi2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
H5_FAILED();
- puts(" Hard link failed for hidden object.");
+ HDputs(" Hard link failed for hidden object.");
TEST_ERROR
} /* end if */
@@ -503,7 +503,7 @@ test_assoc(hid_t fapl)
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
H5_FAILED();
- puts(" Association failed.");
+ HDputs(" Association failed.");
TEST_ERROR
} /* end if */
@@ -628,7 +628,7 @@ test_move(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Moving an object across files should't have been possible");
+ HDputs(" Moving an object across files should't have been possible");
TEST_ERROR
} /* end if */
@@ -834,7 +834,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Incorrect traversal from mount point!");
+ HDputs(" Incorrect traversal from mount point!");
TEST_ERROR
} /* end if */
@@ -851,7 +851,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
@@ -859,7 +859,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
@@ -873,7 +873,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
@@ -881,7 +881,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -1005,7 +1005,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile hard link should not have been allowed!");
+ HDputs(" Interfile hard link should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1015,7 +1015,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile renaming should not have been allowed!");
+ HDputs(" Interfile renaming should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1033,7 +1033,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(dset >= 0) {
H5_FAILED();
- puts(" Dataset and shared type must be in the same file!");
+ HDputs(" Dataset and shared type must be in the same file!");
TEST_ERROR
} /* end if */
@@ -1172,7 +1172,7 @@ test_close(hid_t fapl)
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
if(H5Oget_info_by_name2(file2, "/mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) {
H5_FAILED();
- puts(" File1 contents are not accessible!");
+ HDputs(" File1 contents are not accessible!");
TEST_ERROR
} /* end if */
if(H5Fclose(file2) < 0) FAIL_STACK_ERROR
@@ -4379,13 +4379,13 @@ main(void)
if (nerrors) goto error;
- puts("All mount tests passed.");
+ HDputs("All mount tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
error:
- puts("***** MOUNT ERRORS *****");
+ HDputs("***** MOUNT ERRORS *****");
return 1;
}
diff --git a/test/titerate.c b/test/titerate.c
index de652a7..2a6f521 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -104,7 +104,7 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_
return(count2 > 10 ? 1 : 0);
default:
- printf("invalid iteration command");
+ HDprintf("invalid iteration command");
return(-1);
} /* end switch */
} /* end liter_cb() */
@@ -151,7 +151,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
CHECK(filespace, FAIL, "H5Screate");
for(i=0; i< NDATASETS; i++) {
- sprintf(name,"Dataset %d",i);
+ HDsprintf(name,"Dataset %d",i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -725,7 +725,7 @@ static void test_grp_memb_funcs(hid_t fapl)
CHECK(filespace, FAIL, "H5Screate");
for(i = 0; i < NDATASETS; i++) {
- sprintf(name, "Dataset %d", i);
+ HDsprintf(name, "Dataset %d", i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -976,6 +976,6 @@ test_iterate(void)
void
cleanup_iterate(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/tselect.c b/test/tselect.c
index 3c93e7a..12935ea 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -11982,7 +11982,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_reg1);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be TRUE. */
if(!rebuild_stat){
ret = FAIL;
@@ -12061,7 +12061,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_reg2);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be TRUE. */
if(!rebuild_stat){
ret = FAIL;
@@ -12098,7 +12098,7 @@ test_space_rebuild(void)
rebuild_stat = TRUE;
rebuild_stat = H5S_get_rebuild_status_test(sid_irreg2);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(rebuild_stat){
ret = FAIL;
@@ -12150,7 +12150,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_reg3);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be TRUE. */
if(!rebuild_stat){
@@ -12193,7 +12193,7 @@ test_space_rebuild(void)
rebuild_stat = TRUE;
rebuild_stat = H5S_get_rebuild_status_test(sid_irreg3);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(rebuild_stat){
ret = FAIL;
@@ -12253,7 +12253,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_reg4);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be TRUE. */
if(!rebuild_stat){
ret = FAIL;
@@ -12306,7 +12306,7 @@ test_space_rebuild(void)
rebuild_stat = TRUE;
rebuild_stat = H5S_get_rebuild_status_test(sid_irreg4);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(rebuild_stat){
ret = FAIL;
@@ -12370,7 +12370,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_reg5);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be TRUE. */
if(!rebuild_stat){
ret = FAIL;
@@ -12428,7 +12428,7 @@ test_space_rebuild(void)
rebuild_stat = TRUE;
rebuild_stat = H5S_get_rebuild_status_test(sid_irreg5);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(rebuild_stat){
ret = FAIL;
@@ -12491,7 +12491,7 @@ test_space_rebuild(void)
rebuild_stat = TRUE;
rebuild_stat = H5S_get_rebuild_status_test(sid_spec);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(rebuild_stat){
ret = FAIL;
@@ -12514,7 +12514,7 @@ test_space_rebuild(void)
rebuild_stat = FALSE;
rebuild_stat = H5S_get_rebuild_status_test(sid_spec);
- assert(rebuild_stat!=FAIL);
+ HDassert(rebuild_stat!=FAIL);
/* In this case, rebuild_stat should be FALSE. */
if(!rebuild_stat){
ret = FAIL;
@@ -13848,6 +13848,6 @@ test_select(void)
void
cleanup_select(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tsohm.c b/test/tsohm.c
index bd73d00..5c3707f 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -621,12 +621,12 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, int test_file_clos
HDmemset(&rdata, 0, sizeof(rdata)); \
if (0 > H5Dread((dset_id), (dtype_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata)) { \
H5_FAILED(); AT(); \
- printf("Can't read data\n"); \
+ HDprintf("Can't read data\n"); \
goto error; \
} \
if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str)) { \
H5_FAILED(); AT(); \
- printf("incorrect read data\n"); \
+ HDprintf("incorrect read data\n"); \
goto error; \
} \
} /* TSOHM_S1H_VERIFY_DATA() definition */
@@ -1383,7 +1383,7 @@ size2_verify_plist1(hid_t plist)
ret = H5Pget_fill_value(plist, dtype1_id, &fill1);
CHECK_I(ret, "H5Pget_fill_value");
- ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
+ ret = HDmemcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
VERIFY(ret, 0, "memcmp");
ret = H5Tclose(dtype1_id);
@@ -1482,15 +1482,15 @@ size2_verify_plist2(hid_t plist)
static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
- puts(name);
- printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
- printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
- printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
- printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
- printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
- printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
- printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
+ HDputs(name);
+ HDprintf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ HDprintf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ HDprintf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ HDprintf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ HDprintf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ HDprintf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ HDprintf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ HDprintf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
} /* size2_dump_struct */
#endif /* NOT_NOW */
@@ -3862,8 +3862,8 @@ test_sohm(void)
void
cleanup_sohm(void)
{
- remove(FILENAME);
- remove(FILENAME_SRC);
- remove(FILENAME_DST);
+ HDremove(FILENAME);
+ HDremove(FILENAME_SRC);
+ HDremove(FILENAME_DST);
} /* cleanup_sohm */
diff --git a/test/ttime.c b/test/ttime.c
index 48c9ba8..5b3436d 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -178,13 +178,13 @@ test_time_io(void)
tid = H5Dget_type(dsid);
CHECK(tid, FAIL, "H5Dget_type");
if( H5Tget_class (tid) == H5T_TIME)
- fprintf(stderr,"datatype class is H5T_TIME\n");
+ HDfprintf(stderr,"datatype class is H5T_TIME\n");
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
status = H5Dread (dsid, H5T_UNIX_D32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timethen);
CHECK(status, FAIL, "H5Dread");
-fprintf(stderr,"time written was: %s\n", HDctime(&timethen));
+HDfprintf(stderr,"time written was: %s\n", HDctime(&timethen));
status = H5Dclose(dsid);
CHECK(status, FAIL, "H5Dclose");
@@ -231,6 +231,6 @@ test_time(void)
void
cleanup_time(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/tunicode.c b/test/tunicode.c
index 5a60036..255dc50 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -854,7 +854,7 @@ void test_unicode(void)
*/
void cleanup_unicode(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tvlstr.c b/test/tvlstr.c
index da6195c..77589bb 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -183,7 +183,7 @@ test_vlstrings_basic(void)
/* Count the actual number of bytes used by the strings */
for(i=0,str_used=0; i<SPACE1_DIM1; i++)
- str_used+=HDstrlen(wdata[i])+1;
+ str_used += HDstrlen(wdata[i])+1;
/* Compare against the strings actually written */
VERIFY(size,(hsize_t)str_used,"H5Dvlen_get_buf_size");
@@ -198,7 +198,7 @@ test_vlstrings_basic(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
@@ -300,7 +300,7 @@ test_vlstrings_special(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
@@ -527,7 +527,7 @@ test_compact_vlstring(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -802,33 +802,33 @@ static void test_vl_rewrite(void)
/* Create in file 1 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
write_scalar_dset(file1, type, space, name, name);
}
/* Effectively copy data from file 1 to 2 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
}
/* Read back from file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file2, type, space, name, name);
} /* end for */
/* Remove from file 2. */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
ret = H5Ldelete(file2, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
} /* end for */
/* Effectively copy from file 1 to file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
} /* end for */
diff --git a/test/vds.c b/test/vds.c
index 4f03bbd..67af8e3 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -378,7 +378,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
if(config == TEST_API_REOPEN_FILE) {
if(oinfo.meta_size.obj.heap_size != exp_meta_size) {
- printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
+ HDprintf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
TEST_ERROR
}
}
@@ -11619,7 +11619,7 @@ main(void)
for(test_api_config = (int)TEST_API_BASIC; test_api_config < (int)TEST_API_NTESTS; test_api_config++)
nerrors += test_api((test_api_config_t)test_api_config, fapl);
for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
- printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
+ HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
nerrors += test_basic_io(bit_config, fapl);
nerrors += test_vds_prefix(bit_config, fapl);
nerrors += test_unlim(bit_config, fapl);
@@ -11634,14 +11634,14 @@ main(void)
if(nerrors)
goto error;
- printf("All virtual dataset tests passed.\n");
+ HDprintf("All virtual dataset tests passed.\n");
h5_cleanup(FILENAME, fapl);
return EXIT_SUCCESS;
error:
nerrors = MAX(1, nerrors);
- printf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/vfd.c b/test/vfd.c
index 19223ea..2305593 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -412,8 +412,8 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pr++ != *pw++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -480,8 +480,8 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pw++ != *pr++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -597,7 +597,7 @@ test_direct(void)
if(file<0) {
H5Pclose (fapl);
SKIPPED();
- printf(" Probably the file system doesn't support Direct I/O\n");
+ HDprintf(" Probably the file system doesn't support Direct I/O\n");
return 0;
}
@@ -674,8 +674,8 @@ test_direct(void)
for(j = 0; j < DSET1_DIM2; j++)
if(*p1++ != *p2++) {
H5_FAILED();
- printf(" Read different values than written in data set 1.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set 1.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -706,8 +706,8 @@ test_direct(void)
for(i = 0; i < DSET2_DIM; i++)
if(wdata2[i] != rdata2[i]) {
H5_FAILED();
- printf(" Read different values than written in data set 2.\n");
- printf(" At index %d\n", i);
+ HDprintf(" Read different values than written in data set 2.\n");
+ HDprintf(" At index %d\n", i);
TEST_ERROR;
} /* end if */
@@ -1199,19 +1199,19 @@ test_multi(void)
memb_map[H5FD_MEM_BTREE] = H5FD_MEM_BTREE;
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP;
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
+ HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
- sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b');
+ HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b');
memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE];
memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/4;
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
+ HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
- sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g');
+ HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g');
memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP];
memb_addr[H5FD_MEM_GHEAP] = (HADDR_MAX/4)*3;
@@ -1431,12 +1431,12 @@ test_multi_compat(void)
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
+ HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
+ HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
@@ -1446,17 +1446,19 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
/* Make copy for the data file in the build directory, to protect the
- * original file in the source directory */
- sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
- sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
+ * original file in the source directory
+ */
+ HDsprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
+ HDsprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
h5_make_local_copy(filename_s, newname_s);
- sprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
- sprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
+ HDsprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
+ HDsprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
h5_make_local_copy(filename_r, newname_r);
/* Reopen the file for read only. Verify 1.8 library can open file
- * created with 1.6 library. */
+ * created with 1.6 library.
+ */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;