summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-29 12:52:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-29 12:52:10 (GMT)
commit468e38c9e7d82f7cd388f4cd5374525040ce9514 (patch)
treea71193a4a0137328116ea8656dafbde165e987d7
parent83175cb19103db8186cf7ad65bbbea1ef88e0366 (diff)
downloadhdf5-468e38c9e7d82f7cd388f4cd5374525040ce9514.zip
hdf5-468e38c9e7d82f7cd388f4cd5374525040ce9514.tar.gz
hdf5-468e38c9e7d82f7cd388f4cd5374525040ce9514.tar.bz2
[svn-r18664] Description:
Add a few H5Tequal() calls to make certain that the native datatype constructed with H5Tget_native_type() is identical to the memory datatype created from the struct in memory. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
-rw-r--r--test/ntypes.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/ntypes.c b/test/ntypes.c
index 33a14d1..fa208e3 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -412,6 +412,9 @@ test_compound_dtype2(hid_t file)
if((native_type = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
TEST_ERROR;
+ if(H5Tequal(native_type, tid_m) != TRUE)
+ TEST_ERROR;
+
/* Verify the datatype of each field retrieved and converted */
/* check the char member */
if((mem_id = H5Tget_member_type(native_type, 0)) < 0)
@@ -666,6 +669,9 @@ test_compound_dtype(hid_t file)
if((native_type = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
TEST_ERROR;
+ if(H5Tequal(native_type, tid2) != TRUE)
+ TEST_ERROR;
+
/* Verify the datatype of each field retrieved and converted */
if((mem_id = H5Tget_member_type(native_type, 0)) < 0)
TEST_ERROR;
@@ -2572,7 +2578,7 @@ test_bitfield_dtype(hid_t file)
H5P_DEFAULT)) < 0) TEST_ERROR;
for(i = 0; i < BITFIELD_ENUMB*sizeof(int); i++)
- wbuf[i] = (unsigned int)0xff ^ (unsigned int)i;
+ wbuf[i] = (unsigned char)((unsigned int)0xff ^ (unsigned int)i);
if(H5Dwrite(dset1, H5T_NATIVE_B32, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
if(H5Dclose(dset1) < 0) TEST_ERROR;
@@ -2603,12 +2609,12 @@ test_bitfield_dtype(hid_t file)
/* Read the data and compare them */
if(H5Dread(dataset1, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
- p = (unsigned int*)rbuf;
+ p = (unsigned char *)rbuf;
for(i = 0; i < BITFIELD_ENUMB*4; i++) {
if(*p != wbuf[i]) {
H5_FAILED();
printf(" Read different values than written.\n");
- printf(" At index %d\n", i);
+ printf(" At index %zu\n", i);
TEST_ERROR;
}
p++;
@@ -2633,7 +2639,7 @@ test_bitfield_dtype(hid_t file)
if(intr[i] != intw[i]) {
H5_FAILED();
printf(" Read different values than written.\n");
- printf(" At index %d\n", i);
+ printf(" At index %zu\n", i);
TEST_ERROR;
}
}