summaryrefslogtreecommitdiffstats
path: root/test/ntypes.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-05-16 15:18:10 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-05-16 15:18:10 (GMT)
commit3edbf40ed20587c9ad742e51657047836967e4b5 (patch)
tree1384c3781ccf2b8ce7f9b0fcab97d94a8541155b /test/ntypes.c
parentd792fc837dc2e4e65211b3a9b13ac30343263610 (diff)
downloadhdf5-3edbf40ed20587c9ad742e51657047836967e4b5.zip
hdf5-3edbf40ed20587c9ad742e51657047836967e4b5.tar.gz
hdf5-3edbf40ed20587c9ad742e51657047836967e4b5.tar.bz2
[svn-r6884] Purpose: bug fix
Description: H5Tget_native_type didn't handle special platform like Cray properly. Solution: modify algorithm and test Platforms tested: h5committest
Diffstat (limited to 'test/ntypes.c')
-rw-r--r--test/ntypes.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/ntypes.c b/test/ntypes.c
index 0bc37df..4c877ee 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -114,7 +114,7 @@ test_atomic_dtype(hid_t file)
/* Verify the datatype retrieved and converted */
if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_INT))
TEST_ERROR;
- if(sizeof(int)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(H5T_STD_I32BE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
@@ -152,7 +152,7 @@ test_atomic_dtype(hid_t file)
/* Verify the datatype retrieved and converted */
if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
- if(sizeof(long_long)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(H5T_STD_I64LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
@@ -173,7 +173,7 @@ test_atomic_dtype(hid_t file)
/* Verify the datatype retrieved and converted */
if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_CHAR))
TEST_ERROR;
- if(sizeof(char)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(H5T_NATIVE_CHAR))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
@@ -194,7 +194,7 @@ test_atomic_dtype(hid_t file)
/* Verify the datatype retrieved and converted */
if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_FLOAT))
TEST_ERROR;
- if(sizeof(float)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(H5T_NATIVE_FLOAT))
TEST_ERROR;
if(H5T_FLOAT!=H5Tget_class(native_type))
TEST_ERROR;
@@ -215,7 +215,7 @@ test_atomic_dtype(hid_t file)
/* Verify the datatype retrieved and converted */
if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_DOUBLE))
TEST_ERROR;
- if(sizeof(double)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(H5T_IEEE_F64BE))
TEST_ERROR;
if(H5T_FLOAT!=H5Tget_class(native_type))
TEST_ERROR;
@@ -350,11 +350,6 @@ test_compound_dtype2(hid_t file)
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
- /* Close temporary datatypes */
- if(H5Tclose(tid2)<0) TEST_ERROR;
- if(H5Tclose(tid)<0) TEST_ERROR;
- if(H5Tclose(tid_m2)<0) TEST_ERROR;
-
/* Close dataspace */
if(H5Sclose(space)<0) TEST_ERROR;
@@ -367,7 +362,7 @@ test_compound_dtype2(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
- if(sizeof(s1)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(tid_m))
TEST_ERROR;
if(!H5Tequal(native_type, tid_m))
TEST_ERROR;
@@ -392,6 +387,11 @@ test_compound_dtype2(hid_t file)
}
}
+ /* Close temporary datatypes */
+ if(H5Tclose(tid2)<0) TEST_ERROR;
+ if(H5Tclose(tid)<0) TEST_ERROR;
+ if(H5Tclose(tid_m2)<0) TEST_ERROR;
+
/* Close HDF5 objects */
H5Dclose(dataset);
H5Tclose(dtype);
@@ -493,9 +493,6 @@ test_compound_dtype(hid_t file)
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
- /* Close datatype */
- if(H5Tclose(tid)<0) TEST_ERROR;
-
/* Close dataspace */
if(H5Sclose(space)<0) TEST_ERROR;
@@ -508,7 +505,7 @@ test_compound_dtype(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
- if(sizeof(s1)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(tid2))
TEST_ERROR;
if(!H5Tequal(native_type, tid2))
TEST_ERROR;
@@ -531,6 +528,9 @@ test_compound_dtype(hid_t file)
}
}
+ /* Close datatype */
+ if(H5Tclose(tid)<0) TEST_ERROR;
+
H5Dclose(dataset);
H5Tclose(dtype);
H5Tclose(native_type);
@@ -650,7 +650,7 @@ test_compound_dtype3(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
- if(sizeof(s1)!=H5Tget_size(native_type))
+ if(H5Tget_size(native_type) != H5Tget_size(tid_m))
TEST_ERROR;
if(!H5Tequal(native_type, tid_m))
TEST_ERROR;