summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2010-08-18 19:32:26 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2010-08-18 19:32:26 (GMT)
commitd221d97f992d66540d39b0dfdca80b37849a7dd6 (patch)
tree49d1ef12bb771273d1b168c3c62a4490f4d6d46f /test/dsets.c
parent0949a25c13b4fa4e139b96eb0355d1ce0111e312 (diff)
downloadhdf5-d221d97f992d66540d39b0dfdca80b37849a7dd6.zip
hdf5-d221d97f992d66540d39b0dfdca80b37849a7dd6.tar.gz
hdf5-d221d97f992d66540d39b0dfdca80b37849a7dd6.tar.bz2
[svn-r19250] New feature(bug #1934): I made H5Tset_order support all data types with some restictions:
1. For enum type, members shouldn't be defined yet. 2. H5T_ORDER_NONE only works for reference and fixed-length string. 3. For opaque type, the order will be ignored. 4. For compound type, all restrictions above apply to the members. I'll change H5Tget_order and do another commit. Tested on jam, heiwa, and amani.
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/dsets.c b/test/dsets.c
index da7d106..30291df 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -3266,11 +3266,6 @@ test_nbit_compound(hid_t file)
if(H5Tinsert(mem_cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
if(H5Tinsert(mem_cmpd_tid, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error;
- /* Set order of dataset compound member datatype */
- if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error;
- if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error;
- if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error;
-
/* Create a dataset compound datatype and insert some atomic types */
cmpd_tid = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
if(H5Tinsert(cmpd_tid, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
@@ -3278,6 +3273,9 @@ test_nbit_compound(hid_t file)
if(H5Tinsert(cmpd_tid, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
+ /* Set order of dataset compound datatype */
+ if(H5Tset_order(cmpd_tid, H5T_ORDER_BE) < 0) goto error;
+
/* Create the data space */
if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
@@ -3482,11 +3480,6 @@ test_nbit_compound_2(hid_t file)
if(H5Tinsert(mem_cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
if(H5Tinsert(mem_cmpd_tid1, "f", HOFFSET(atomic, f), H5T_NATIVE_FLOAT) < 0) goto error;
- /* Set order of dataset atomic compound member datatype */
- if(H5Tset_order(i_tid, H5T_ORDER_BE) < 0) goto error;
- if(H5Tset_order(c_tid, H5T_ORDER_BE) < 0) goto error;
- if(H5Tset_order(s_tid, H5T_ORDER_BE) < 0) goto error;
-
/* Create a dataset atomic compound datatype and insert some atomic types */
cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(atomic));
if(H5Tinsert(cmpd_tid1, "i", HOFFSET(atomic, i), i_tid) < 0) goto error;
@@ -3494,6 +3487,9 @@ test_nbit_compound_2(hid_t file)
if(H5Tinsert(cmpd_tid1, "s", HOFFSET(atomic, s), s_tid) < 0) goto error;
if(H5Tinsert(cmpd_tid1, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
+ /* Set order of dataset compound datatype */
+ if(H5Tset_order(cmpd_tid1, H5T_ORDER_BE) < 0) goto error;
+
/* Set precision and offset of the other data member */
if(H5Tset_precision(v_tid,precision[3]) < 0) goto error;
if(H5Tset_offset(v_tid,offset[3]) < 0) goto error;