summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-29 13:04:33 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-29 13:04:33 (GMT)
commitca02b2da5880fb7e9d92869e07d543d52aa34d63 (patch)
treebdeac6113786b3d117443e2034f9f2903f818d2e
parentd0a1730ad855a181e5d7f31071c29a131b1449bd (diff)
downloadhdf5-ca02b2da5880fb7e9d92869e07d543d52aa34d63.zip
hdf5-ca02b2da5880fb7e9d92869e07d543d52aa34d63.tar.gz
hdf5-ca02b2da5880fb7e9d92869e07d543d52aa34d63.tar.bz2
[svn-r18665] Description:
Bring r18664 from trunk to 1.8 branch: 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: 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 (h5committested on trunk)
-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;
}
}