summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-10-09 04:18:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-10-09 04:18:18 (GMT)
commit14dcb6db33f88011c3499d439c53890ab09d1ba2 (patch)
treecc05060f7dd94342c2e06726ef6b550bf4a7d8f1 /test/dtypes.c
parent20720af231c875330a6074f65ee1c54e6a806fbb (diff)
downloadhdf5-14dcb6db33f88011c3499d439c53890ab09d1ba2.zip
hdf5-14dcb6db33f88011c3499d439c53890ab09d1ba2.tar.gz
hdf5-14dcb6db33f88011c3499d439c53890ab09d1ba2.tar.bz2
[svn-r12736] Description:
Add "use the latest format" support for dataspace object header encode/ decode routines and clean up format a bit for the latest format (new to 1.8.x releases) Remove storing 'perm' parameter for array datatypes in memory and the file, and add test to make certain that if any user applications are attempting to store them, we get some reports back. (Should be unlikely, since the RefMan says that the parameter is not implemented and is unsupported). Carry those changes into the tests, etc. Clean up a bunch more compiler warnings. Tested on: FreeBSD/32 4.11 (sleipnir) w/threadsafe Linux/32 2.4 (heping) w/FORTRAN & C++ Linux/64 2.4 (mir) w/enable-1.6-compat
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 98c2796..c9e7143 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -328,7 +328,7 @@ test_detect(void)
hid_t atom_vlc_id; /* Atomic VL datatype of char */
hid_t atom_vls_id; /* Atomic VL string datatype */
hid_t cplx_cmpd_id; /* Complex Compound datatype */
- int rank=2; /* Rank for array datatype */
+ unsigned rank = 2; /* Rank for array datatype */
hsize_t dims[2]={3,3}; /* Dimensions for array datatype */
TESTING("H5Tdetect_class()");
@@ -366,8 +366,20 @@ test_detect(void)
/*--------------------------------------------------------------------------------
* Test class of some complex types.
*------------------------------------------------------------------------------*/
+ /* Try to create array datatype with a dimension permutation (should fail) */
+ H5E_BEGIN_TRY {
+ int perm[2]={0,1}; /* Dimensions permutations for array datatype */
+
+ atom_arr_id = H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, perm);
+ } H5E_END_TRY;
+ if(atom_arr_id>=0) {
+ H5_FAILED();
+ printf("Dimension permutation accepted?\n");
+ goto error;
+ } /* end if */
+
/* Create an array datatype with an atomic base type */
- if((atom_arr_id=H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, NULL))<0) TEST_ERROR
+ if((atom_arr_id = H5Tarray_create(H5T_STD_REF_OBJ, rank, dims, NULL)) < 0) TEST_ERROR
/* Make certain that the correct classes can be detected */
if(H5Tdetect_class(atom_arr_id,H5T_ARRAY)!=TRUE) TEST_ERROR
@@ -687,7 +699,7 @@ test_compound_2(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -697,7 +709,7 @@ test_compound_2(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "b", HOFFSET(struct dt, b), H5T_NATIVE_INT)<0 ||
@@ -804,7 +816,7 @@ test_compound_3(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -814,7 +826,7 @@ test_compound_3(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "c", HOFFSET(struct dt, c), array_dt)<0 ||
@@ -922,7 +934,7 @@ test_compound_4(void)
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
/* Build hdf5 datatypes */
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 ||
H5Tinsert(st, "a", HOFFSET(struct st, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(st, "b", HOFFSET(struct st, b), H5T_NATIVE_INT)<0 ||
@@ -932,7 +944,7 @@ test_compound_4(void)
goto error;
H5Tclose(array_dt);
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL);
if ((dt=H5Tcreate(H5T_COMPOUND, sizeof(struct dt)))<0 ||
H5Tinsert(dt, "a", HOFFSET(struct dt, a), H5T_NATIVE_INT)<0 ||
H5Tinsert(dt, "b", HOFFSET(struct dt, b), H5T_NATIVE_SHORT)<0 ||
@@ -1040,12 +1052,12 @@ test_compound_5(void)
/* Build datatypes */
short_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(short));
- array_dt=H5Tarray_create(H5T_NATIVE_SHORT, 1, dims, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_SHORT, 1, dims, NULL);
H5Tinsert(short_array, "_", 0, array_dt);
H5Tclose(array_dt);
int_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(int));
- array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
+ array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
H5Tinsert(int_array, "_", 0, array_dt);
H5Tclose(array_dt);
@@ -1794,7 +1806,7 @@ test_compound_10(void)
} /* end if */
/* Create the array data type for c_string data */
- if((arr_tid = H5Tarray_create(cmpd_tid,1,arr_dim, NULL))<0) {
+ if((arr_tid = H5Tarray_create(cmpd_tid, 1, arr_dim, NULL)) < 0) {
H5_FAILED(); AT();
printf("Can't create array type\n");
goto error;