summaryrefslogtreecommitdiffstats
path: root/test/bittests.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-01-25 17:03:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-01-25 17:03:29 (GMT)
commita319837a4fd95c29e6754593264c1429deaa506b (patch)
tree930ac1ddbc4381c1ce5ef33f00c96f9073ff3e9a /test/bittests.c
parent51bd03c8a5e3c1ffbf46edb9feee1f8776e4e462 (diff)
downloadhdf5-a319837a4fd95c29e6754593264c1429deaa506b.zip
hdf5-a319837a4fd95c29e6754593264c1429deaa506b.tar.gz
hdf5-a319837a4fd95c29e6754593264c1429deaa506b.tar.bz2
[svn-r3326] Purpose:
Clean up warnings Description: The "FAILED" macro is defined by Windows and is causing warnings and potential errors when compiled on that platform. Solution: Change our macro from FAILED to H5_FAILED. Platforms tested: FreeBSD 4.2 (hawkwind)
Diffstat (limited to 'test/bittests.c')
-rw-r--r--test/bittests.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/test/bittests.c b/test/bittests.c
index 2c8daef..a8b8471 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -46,13 +46,13 @@ test_find (void)
memset (v1, 0xaa, sizeof v1);
n = H5T_bit_find (v1, 0, 0, H5T_BIT_LSB, TRUE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" Zero length test failed (lsb)!");
goto failed;
}
n = H5T_bit_find (v1, 0, 0, H5T_BIT_MSB, TRUE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" Zero length test failed (msb)!");
goto failed;
}
@@ -62,13 +62,13 @@ test_find (void)
memset (v1, 0, sizeof v1);
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_LSB, TRUE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" Zero buffer test failed (lsb)!");
goto failed;
}
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_MSB, TRUE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" Zero buffer test failed (msb)!");
goto failed;
}
@@ -79,13 +79,13 @@ test_find (void)
v1[i/8] = 1<<(i%8);
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_LSB, TRUE);
if ((ssize_t)i!=n) {
- FAILED();
+ H5_FAILED();
printf (" Test for set bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_MSB, TRUE);
if ((ssize_t)i!=n) {
- FAILED();
+ H5_FAILED();
printf (" Test for set bit %d failed (msb)!\n", i);
goto failed;
}
@@ -95,13 +95,13 @@ test_find (void)
memset (v1, 0xff, sizeof v1);
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_LSB, FALSE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" One buffer test failed (lsb)!");
goto failed;
}
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_MSB, FALSE);
if (-1!=n) {
- FAILED();
+ H5_FAILED();
puts (" One buffer test failed (msb)!");
goto failed;
}
@@ -112,13 +112,13 @@ test_find (void)
v1[i/8] &= ~(1<<(i%8));
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_LSB, FALSE);
if ((ssize_t)i!=n) {
- FAILED();
+ H5_FAILED();
printf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_MSB, FALSE);
if ((ssize_t)i!=n) {
- FAILED();
+ H5_FAILED();
printf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
@@ -174,12 +174,12 @@ test_copy (void)
H5T_bit_copy (v2, d_offset, v1, s_offset, size);
for (j=0; j<(intn)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Unabled to find copied region in destination");
goto failed;
}
if (0==size && j<(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Found copied bits when we shouldn't have");
goto failed;
}
@@ -188,25 +188,25 @@ test_copy (void)
/* Look for the zeros and ones */
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find first copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" 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) {
- FAILED();
+ H5_FAILED();
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) {
- FAILED();
+ H5_FAILED();
puts (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -217,25 +217,25 @@ test_copy (void)
*/
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find last copied bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found copied bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T_bit_find (v2, 0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find beginning of copied data "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found leading original data but shouldn't have!");
goto failed;
}
@@ -294,12 +294,12 @@ test_set (void)
H5T_bit_set (v2, d_offset, size, TRUE);
for (j=0; j<(intn)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Unabled to find set region in buffer");
goto failed;
}
if (0==size && j<(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Found set bits when we shouldn't have");
goto failed;
}
@@ -308,25 +308,25 @@ test_set (void)
/* Look for the zeros and ones */
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find first set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" 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) {
- FAILED();
+ H5_FAILED();
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) {
- FAILED();
+ H5_FAILED();
puts (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -337,25 +337,25 @@ test_set (void)
*/
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find last set bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found set bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T_bit_find (v2, 0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find beginning of set bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found leading zeros but shouldn't have!");
goto failed;
}
@@ -411,12 +411,12 @@ test_clear (void)
H5T_bit_set (v2, d_offset, size, FALSE);
for (j=0; j<(intn)sizeof(v2); j++) if (0xff!=v2[j]) break;
if (size>0 && j>=(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Unabled to find cleared region in buffer");
goto failed;
}
if (0==size && j<(intn)sizeof(v2)) {
- FAILED();
+ H5_FAILED();
puts (" Found cleared bits when we shouldn't have");
goto failed;
}
@@ -425,25 +425,25 @@ test_clear (void)
/* Look for the zeros and ones */
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_LSB, 0);
if (size>0 && n!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find first cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" 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) {
- FAILED();
+ H5_FAILED();
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) {
- FAILED();
+ H5_FAILED();
puts (" High-order ones are present and shouldn't be!");
goto failed;
}
@@ -454,25 +454,25 @@ test_clear (void)
*/
n = H5T_bit_find (v2, 0, 8*sizeof(v2), H5T_BIT_MSB, 0);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find last cleared bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found cleared bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T_bit_find (v2, 0, d_offset+size, H5T_BIT_MSB, 1);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
- FAILED();
+ H5_FAILED();
printf (" Unable to find beginning of cleared bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
- FAILED();
+ H5_FAILED();
puts (" Found leading ones but shouldn't have!");
goto failed;
}