summaryrefslogtreecommitdiffstats
path: root/test/ntypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-08-13 20:53:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-08-13 20:53:35 (GMT)
commit6b45f5172ccb4311e0be9ae15da3758abb6b0e67 (patch)
tree5a7a112fe7a8a98c6fecb45b513789d15962eb3d /test/ntypes.c
parent6562465a2c2a58cfbc2f47bf60bb538f7a783933 (diff)
downloadhdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.zip
hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.gz
hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.bz2
[svn-r11245] Purpose:
Code cleanup Description: Trim trailing whitespace, which is making 'diff'ing the two branches difficult. Solution: Ran this script in each directory: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'test/ntypes.c')
-rw-r--r--test/ntypes.c414
1 files changed, 207 insertions, 207 deletions
diff --git a/test/ntypes.c b/test/ntypes.c
index 83b7c5b..ef2c2b2 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -14,7 +14,7 @@
/*
* Programmer: Raymond Lu
- * October 14, 2001
+ * October 14, 2001
*
* Purpose: Tests the H5Tget_native_type function.
*/
@@ -115,33 +115,33 @@ test_atomic_dtype(hid_t file)
if((dataset=H5Dopen(file, DSET_ATOMIC_NAME_1))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
/* Verify the datatype retrieved and converted */
- if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_INT))
+ if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_INT))
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I32BE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
- /* Read the dataset back. The temporary buffer is for special platforms
+ /* Read the dataset back. The temporary buffer is for special platforms
* like Cray. */
tmp = malloc((size_t)(DIM0*DIM1*H5Tget_size(native_type)));
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
-
+
/* Copy data from temporary buffer to destination buffer */
- memcpy(icheck2, tmp, (size_t)(DIM0*DIM1*H5Tget_size(native_type)));
+ memcpy(icheck2, tmp, (size_t)(DIM0*DIM1*H5Tget_size(native_type)));
free(tmp);
-
+
/* Convert to the integer type */
if(H5Tconvert(native_type, H5T_NATIVE_INT, (DIM0*DIM1), icheck2, NULL, H5P_DEFAULT)<0)
TEST_ERROR;
-
+
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++) {
for (j = 0; j < DIM1; j++) {
@@ -165,18 +165,18 @@ test_atomic_dtype(hid_t file)
H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
-
+
/* Verify the datatype retrieved and converted */
- if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_LLONG))
+ if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I64LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
-
+
if(H5Dclose(dataset)<0) TEST_ERROR;
if(H5Tclose(native_type)<0) TEST_ERROR;
if(H5Tclose(dtype)<0) TEST_ERROR;
@@ -187,70 +187,70 @@ test_atomic_dtype(hid_t file)
H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_ASCEND))<0)
TEST_ERROR;
-
+
/* Verify the datatype retrieved and converted */
- if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_CHAR))
+ if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_CHAR))
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I8LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(native_type))
TEST_ERROR;
-
+
if(H5Dclose(dataset)<0) TEST_ERROR;
if(H5Tclose(native_type)<0) TEST_ERROR;
if(H5Tclose(dtype)<0) TEST_ERROR;
-
-
+
+
/* Create the dataset of H5T_IEEE_F32BE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space,
H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND))<0)
TEST_ERROR;
-
+
/* Verify the datatype retrieved and converted */
- if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_FLOAT))
+ if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_FLOAT))
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F32BE))
TEST_ERROR;
if(H5T_FLOAT!=H5Tget_class(native_type))
TEST_ERROR;
-
+
if(H5Dclose(dataset)<0) TEST_ERROR;
if(H5Tclose(native_type)<0) TEST_ERROR;
if(H5Tclose(dtype)<0) TEST_ERROR;
-
-
+
+
/* Create the dataset of H5T_IEEE_F64BE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space,
H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND))<0)
TEST_ERROR;
-
+
/* Verify the datatype retrieved and converted */
- if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_DOUBLE))
+ if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_DOUBLE))
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F64BE))
TEST_ERROR;
if(H5T_FLOAT!=H5Tget_class(native_type))
TEST_ERROR;
-
+
if(H5Dclose(dataset)<0) TEST_ERROR;
if(H5Tclose(native_type)<0) TEST_ERROR;
if(H5Tclose(dtype)<0) TEST_ERROR;
-
-
+
+
/* Close dataspace */
if(H5Sclose(space)<0) TEST_ERROR;
-
+
PASSED();
return 0;
@@ -377,9 +377,9 @@ test_compound_dtype2(hid_t file)
if(H5Dclose(dataset)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
+
-
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_2))<0) TEST_ERROR;
@@ -387,34 +387,34 @@ test_compound_dtype2(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
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)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
- /* check the integer member */
+
+ /* check the integer member */
if((mem_id = H5Tget_member_type(native_type, 1))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_INT))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_INT))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I32LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* check the long long member */
if((mem_id = H5Tget_member_type(native_type, 3))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_ULLONG))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_ULLONG))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U64BE))
TEST_ERROR;
@@ -425,10 +425,10 @@ test_compound_dtype2(hid_t file)
/* check the nested compound member */
if((nest_mem_id = H5Tget_member_type(native_type, 2))<0)
TEST_ERROR;
-
+
if((mem_id = H5Tget_member_type(nest_mem_id, 0))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_SHORT))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_SHORT))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I16BE))
TEST_ERROR;
@@ -438,7 +438,7 @@ test_compound_dtype2(hid_t file)
if((mem_id = H5Tget_member_type(nest_mem_id, 1))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LONG))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LONG))
TEST_ERROR;
#if H5_SIZEOF_LONG==4
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I32LE)) TEST_ERROR;
@@ -450,13 +450,13 @@ test_compound_dtype2(hid_t file)
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
if((bkg=calloc(sizeof(s1),DIM0*DIM1))==NULL)
TEST_ERROR;
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
@@ -573,7 +573,7 @@ test_compound_dtype(hid_t file)
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR;
if(H5Tinsert(tid, "i", 1, H5T_STD_U32LE)<0) TEST_ERROR;
if(H5Tinsert(tid, "l", 5, H5T_STD_I64BE)<0) TEST_ERROR;
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
@@ -583,7 +583,7 @@ test_compound_dtype(hid_t file)
if(H5Tinsert(tid2, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR;
if(H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_UINT)<0) TEST_ERROR;
if(H5Tinsert(tid2, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG)<0) TEST_ERROR;
-
+
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
TEST_ERROR;
@@ -592,9 +592,9 @@ test_compound_dtype(hid_t file)
if(H5Dclose(dataset)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
+
-
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_COMPOUND_NAME))<0) TEST_ERROR;
@@ -602,54 +602,54 @@ test_compound_dtype(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
-
+
/* Verify the datatype of each field retrieved and converted */
if((mem_id = H5Tget_member_type(native_type, 0))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
if((mem_id = H5Tget_member_type(native_type, 1))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UINT))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UINT))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U32LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
if((mem_id = H5Tget_member_type(native_type, 2))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
bkg = calloc(sizeof(s1),DIM0*DIM1);
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
-
+
if (H5Tconvert(native_type, tid2, (DIM0*DIM1), check, bkg, H5P_DEFAULT)<0)
TEST_ERROR;
-
+
free(bkg);
-
+
/* Check that the values read are the same as the values written */
for (i = 0, temp_point=points, temp_check=check; i < DIM0; i++) {
for (j = 0; j < DIM1; j++, temp_point++,temp_check++) {
@@ -709,7 +709,7 @@ test_compound_dtype3(hid_t file)
long_long l;
} s1;
hid_t dataset, space;
- hid_t dtype, native_type, tid, tid2, tid_m, tid_m2,
+ hid_t dtype, native_type, tid, tid2, tid_m, tid_m2,
mem_id, nest_mem_id;
hsize_t array_dims[1]={5};
int i, j, k, n;
@@ -717,7 +717,7 @@ test_compound_dtype3(hid_t file)
s1 *temp_point, *temp_check;
s1 *points=NULL, *check=NULL;
void *tmp, *bkg;
-
+
TESTING("compound datatype with array as field");
/* Allocate space for the points & check arrays */
@@ -740,10 +740,10 @@ test_compound_dtype3(hid_t file)
dims[0] = DIM0;
dims[1] = DIM1;
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
-
+
/* Create array datatype */
if((tid2=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Create compound datatype for disk storage */
if((tid=H5Tcreate(H5T_COMPOUND, 29))<0) TEST_ERROR;
@@ -751,14 +751,14 @@ test_compound_dtype3(hid_t file)
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR;
if(H5Tinsert(tid, "a", 1, tid2)<0) TEST_ERROR;
if(H5Tinsert(tid, "l", 21, H5T_STD_I64BE)<0) TEST_ERROR;
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
/* Create array datatype */
if((tid_m2=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Create compound datatype for datatype in memory */
if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR;
if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR;
@@ -777,9 +777,9 @@ test_compound_dtype3(hid_t file)
if(H5Tclose(tid2)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
+
-
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_3))<0) TEST_ERROR;
@@ -787,19 +787,19 @@ test_compound_dtype3(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
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)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* check the array member */
if((mem_id = H5Tget_member_type(native_type, 1))<0)
TEST_ERROR;
@@ -807,7 +807,7 @@ test_compound_dtype3(hid_t file)
TEST_ERROR;
if((nest_mem_id = H5Tget_super(mem_id))<0)
TEST_ERROR;
- if(H5Tget_order(nest_mem_id) != H5Tget_order(H5T_NATIVE_INT))
+ if(H5Tget_order(nest_mem_id) != H5Tget_order(H5T_NATIVE_INT))
TEST_ERROR;
if(H5Tget_size(nest_mem_id) < H5Tget_size(H5T_STD_I32LE))
TEST_ERROR;
@@ -815,24 +815,24 @@ test_compound_dtype3(hid_t file)
TEST_ERROR;
H5Tclose(nest_mem_id);
H5Tclose(mem_id);
-
+
/* check the long long member */
if((mem_id = H5Tget_member_type(native_type, 2))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
if((bkg=calloc(sizeof(s1),DIM0*DIM1))==NULL)
TEST_ERROR;
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
@@ -916,7 +916,7 @@ test_compound_opaque(hid_t file)
s1 *temp_point, *temp_check;
s1 *points=NULL, *check=NULL;
void *tmp, *bkg;
-
+
TESTING("compound datatype with opaque field");
/* Allocate space for the points & check arrays */
@@ -939,11 +939,11 @@ test_compound_opaque(hid_t file)
dims[0] = DIM0;
dims[1] = DIM1;
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
-
+
/* Create opaque datatype */
if((tid2=H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o)))<0) TEST_ERROR;
if(H5Tset_tag(tid2, "testing opaque field")<0) TEST_ERROR;
-
+
/* Create compound datatype for disk storage */
if((tid=H5Tcreate(H5T_COMPOUND, 14))<0) TEST_ERROR;
@@ -951,7 +951,7 @@ test_compound_opaque(hid_t file)
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR;
if(H5Tinsert(tid, "o", 1, tid2)<0) TEST_ERROR;
if(H5Tinsert(tid, "l", 6, H5T_STD_I64BE)<0) TEST_ERROR;
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
@@ -974,9 +974,9 @@ test_compound_opaque(hid_t file)
if(H5Tclose(tid2)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
+
-
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_4))<0) TEST_ERROR;
@@ -984,19 +984,19 @@ test_compound_opaque(hid_t file)
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
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)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* check the array member */
if((mem_id = H5Tget_member_type(native_type, 1))<0)
TEST_ERROR;
@@ -1005,24 +1005,24 @@ test_compound_opaque(hid_t file)
if(H5Tget_size(mem_id) != sizeof(temp_point->o))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* check the long long member */
if((mem_id = H5Tget_member_type(native_type, 2))<0)
TEST_ERROR;
- if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
+ if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG))
TEST_ERROR;
if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE))
TEST_ERROR;
if(H5T_INTEGER!=H5Tget_class(mem_id))
TEST_ERROR;
H5Tclose(mem_id);
-
+
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = HDmalloc(DIM0*DIM1*H5Tget_size(native_type));
if((bkg=HDcalloc(sizeof(s1),DIM0*DIM1))==NULL)
TEST_ERROR;
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
@@ -1121,7 +1121,7 @@ test_enum_dtype(hid_t file)
dims[1] = DIM1;
if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
- /* Construct enum type based on native type */
+ /* Construct enum type based on native type */
if((tid=H5Tenum_create(H5T_STD_I16LE))<0) TEST_ERROR;
for (i = 0; i < 8; i++) {
@@ -1129,19 +1129,19 @@ test_enum_dtype(hid_t file)
sub_colors[i*2+1]=0;
if(H5Tenum_insert(tid, mname[i], &(sub_colors[i*2]))<0) TEST_ERROR;
}
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
- /* Construct enum type based on native type in memory */
+ /* Construct enum type based on native type in memory */
if((tid_m=H5Tenum_create(H5T_NATIVE_SHORT))<0) TEST_ERROR;
for (i = 0; i < 8; i++) {
colors[i] = i;
if(H5Tenum_insert(tid_m, mname[i], &(colors[i]))<0) TEST_ERROR;
}
-
+
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2)<0)
TEST_ERROR;
@@ -1151,28 +1151,28 @@ test_enum_dtype(hid_t file)
/* Close datatype */
if(H5Tclose(tid)<0) TEST_ERROR;
-
+
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_ENUM_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
-
+
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
memcpy(scheck2, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
-
+
if (H5Tconvert(native_type, tid_m, (DIM0*DIM1), scheck2, NULL, H5P_DEFAULT)<0)
TEST_ERROR;
@@ -1183,7 +1183,7 @@ test_enum_dtype(hid_t file)
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
- printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j],
+ printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j],
scheck2[i][j]);
goto error;
}
@@ -1233,7 +1233,7 @@ test_array_dtype(hid_t file)
s1 *temp_point, *temp_check;
s1 *points=NULL, *check=NULL;
void *tmp;
-
+
TESTING("array of compound datatype");
/* Allocate space for the points & check arrays */
@@ -1263,10 +1263,10 @@ test_array_dtype(hid_t file)
if(H5Tinsert(tid2, "c", 0, H5T_STD_U8BE)<0) TEST_ERROR;
if(H5Tinsert(tid2, "i", 1, H5T_STD_U32LE)<0) TEST_ERROR;
if(H5Tinsert(tid2, "l", 5, H5T_STD_I64BE)<0) TEST_ERROR;
-
+
/* Create array datatype for disk storage */
if((tid=H5Tarray_create(tid2, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
@@ -1276,33 +1276,33 @@ test_array_dtype(hid_t file)
if(H5Tinsert(tid3, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR;
if(H5Tinsert(tid3, "i", HOFFSET(s1, i), H5T_NATIVE_UINT)<0) TEST_ERROR;
if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG)<0) TEST_ERROR;
-
+
/* Create array datatype for memory */
if((tid_m=H5Tarray_create(tid3, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
-
+
/* Close datatype */
if(H5Tclose(tid)<0) TEST_ERROR;
if(H5Tclose(tid2)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_ARRAY_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
- /* Read the dataset back. Temporary buffer is for special platforms like
+ /* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
@@ -1311,7 +1311,7 @@ test_array_dtype(hid_t file)
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
-
+
if (H5Tconvert(native_type, tid_m, (DIM0*DIM1), check, NULL, H5P_DEFAULT)<0)
TEST_ERROR;
@@ -1384,7 +1384,7 @@ test_array_dtype2(hid_t file)
/* Initialize the dataset */
for(i = n = 0;i < DIM0; i++)
for(j = 0; j < DIM1; j++)
- for(k = 0; k < 5; k++)
+ for(k = 0; k < 5; k++)
ipoints3[i][j][k] = n++;
/* Create the data space */
@@ -1394,40 +1394,40 @@ test_array_dtype2(hid_t file)
/* Create array datatype for disk storage */
if((tid=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space,
H5P_DEFAULT))<0) TEST_ERROR;
/* Create array datatype for memory */
if((tid_m=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR;
-
+
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints3)<0)
TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
-
+
/* Close datatype */
if(H5Tclose(tid)<0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space)<0) TEST_ERROR;
/* Open dataset again to check H5Tget_native_type */
if((dataset=H5Dopen(file, DSET_ARRAY2_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
/* Read the dataset back. Temporary buffer is for special platforms like
* Cray */
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
-
+
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
TEST_ERROR;
@@ -1481,7 +1481,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_vl_dtype(hid_t file)
{
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
@@ -1492,7 +1492,7 @@ test_vl_dtype(hid_t file)
hid_t dtype, native_type, nat_super_type, tid, tid2, tid_m, tid_m2;
size_t i, j, k;
void* *tmp;
-
+
TESTING("variable length datatype");
/* Allocate and initialize VL data to write */
@@ -1517,7 +1517,7 @@ test_vl_dtype(hid_t file)
}
} /* end for */
} /* end for */
-
+
/* Create dataspace for datasets */
if((space = H5Screate_simple(SPACE1_RANK, dims1, NULL))<0) TEST_ERROR;
@@ -1526,17 +1526,17 @@ test_vl_dtype(hid_t file)
/* Create a VL datatype for disk storage */
tid = H5Tvlen_create (tid2);
-
+
/* Create a dataset */
if((dataset=H5Dcreate(file, DSET_VL_NAME, tid, space, H5P_DEFAULT))<0)
TEST_ERROR;
/* Create a base VL datatype for memory */
if((tid_m2 = H5Tvlen_create (H5T_NATIVE_UINT))<0) TEST_ERROR;
-
+
/* Create a VL datatype for memory */
if((tid_m = H5Tvlen_create (tid_m2))<0) TEST_ERROR;
-
+
/* Write dataset to disk */
if(H5Dwrite(dataset,tid_m,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata)<0) TEST_ERROR;
@@ -1552,11 +1552,11 @@ test_vl_dtype(hid_t file)
/* Get native datatype for dataset */
if((dtype = H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
-
- /* Also get native base type for this nested VL type. Should be an integer type. */
+
+ /* Also get native base type for this nested VL type. Should be an integer type. */
if((nat_super_type=H5Tget_super(native_type))<0)
TEST_ERROR;
if((nat_super_type=H5Tget_super(nat_super_type))<0)
@@ -1564,7 +1564,7 @@ test_vl_dtype(hid_t file)
/* Read dataset from disk */
if(H5Dread(dataset,native_type,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata)<0) TEST_ERROR;
-
+
/* Compare data read in */
for(i=0; i<SPACE1_DIM1; i++) {
if(wdata[i].len!=rdata[i].len) {
@@ -1580,7 +1580,7 @@ test_vl_dtype(hid_t file)
} /* end if */
/* use temporary buffer to convert datatype. This is for special
- * platforms like Cray */
+ * platforms like Cray */
tmp=malloc(t2->len*sizeof(unsigned int));
memcpy(tmp, t2->p, t2->len*H5Tget_size(nat_super_type));
@@ -1595,7 +1595,7 @@ test_vl_dtype(hid_t file)
goto error;
}
} /* end for */
-
+
free(tmp);
} /* end for */
} /* end for */
@@ -1614,11 +1614,11 @@ test_vl_dtype(hid_t file)
if(H5Tclose(dtype)<0) TEST_ERROR;
if(H5Tclose(tid_m)<0) TEST_ERROR;
if(H5Tclose(tid_m2)<0) TEST_ERROR;
-
+
/* Close disk dataspace */
if(H5Sclose(space)<0) TEST_ERROR;
-
+
PASSED();
return 0;
@@ -1643,7 +1643,7 @@ test_vl_dtype(hid_t file)
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_vlstr_dtype(hid_t file)
{
const char *wdata[SPACE1_DIM1]= {
@@ -1671,7 +1671,7 @@ test_vlstr_dtype(hid_t file)
if(H5Tset_size (tid1,H5T_VARIABLE)<0) TEST_ERROR;
if(H5T_STRING!=H5Tget_class(tid1) || !H5Tis_variable_str(tid1))
TEST_ERROR;
-
+
/* Create a dataset */
if((dataset=H5Dcreate(file,DSET_VLSTR_NAME,tid1,sid1,H5P_DEFAULT))<0) TEST_ERROR;
@@ -1692,7 +1692,7 @@ test_vlstr_dtype(hid_t file)
TEST_ERROR;
/* Check if the data type is equal */
- if(!H5Tequal(native_type, tid1))
+ if(!H5Tequal(native_type, tid1))
TEST_ERROR;
/* Read dataset from disk */
@@ -1723,16 +1723,16 @@ test_vlstr_dtype(hid_t file)
/* Close disk dataspace */
if(H5Sclose(sid1)<0) TEST_ERROR;
-
+
/* Free memory for rdata */
for(i=0; i<SPACE1_DIM1; i++) {
HDfree(rdata[i]);
}
-
- PASSED();
- return 0;
-
-error:
+
+ PASSED();
+ return 0;
+
+error:
return -1;
} /* end test_vlstr_dtype() */
@@ -1753,7 +1753,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_str_dtype(hid_t file)
{
const char wdata[SPACE1_DIM1][4]= {
@@ -1781,7 +1781,7 @@ test_str_dtype(hid_t file)
if(H5Tset_size (tid1,4)<0) TEST_ERROR;
if(H5T_STRING!=H5Tget_class(tid1))
TEST_ERROR;
-
+
/* Create a dataset */
if((dataset=H5Dcreate(file,DSET_STR_NAME,tid1,sid1,H5P_DEFAULT))<0) TEST_ERROR;
@@ -1802,7 +1802,7 @@ test_str_dtype(hid_t file)
TEST_ERROR;
/* Check if the data type is equal */
- if(!H5Tequal(native_type, tid1) || H5T_STRING!=H5Tget_class(native_type))
+ if(!H5Tequal(native_type, tid1) || H5T_STRING!=H5Tget_class(native_type))
TEST_ERROR;
/* Read dataset from disk */
@@ -1833,11 +1833,11 @@ test_str_dtype(hid_t file)
/* Close disk dataspace */
if(H5Sclose(sid1)<0) TEST_ERROR;
-
- PASSED();
- return 0;
-
-error:
+
+ PASSED();
+ return 0;
+
+error:
return -1;
} /* end test_str_dtype() */
@@ -1860,7 +1860,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_refer_dtype(hid_t file)
{
@@ -1881,13 +1881,13 @@ test_refer_dtype(hid_t file)
/* Output message about test being performed */
TESTING("reference datatype");
-
+
/* Allocate write & read buffers */
wbuf=HDmalloc(MAX(sizeof(unsigned),sizeof(hobj_ref_t)));
rbuf=HDmalloc(MAX(sizeof(unsigned),sizeof(hobj_ref_t)));
/* Create dataspace for datasets */
- if((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL))<0)
+ if((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL))<0)
TEST_ERROR;
/* Create a group */
@@ -1909,7 +1909,7 @@ test_refer_dtype(hid_t file)
TEST_ERROR;
/* Save datatype for later */
- if(H5Tcommit (group, "Datatype1", tid1)<0)
+ if(H5Tcommit (group, "Datatype1", tid1)<0)
TEST_ERROR;
/* Close datatype */
@@ -1917,7 +1917,7 @@ test_refer_dtype(hid_t file)
TEST_ERROR;
/* Close group */
- if(H5Gclose(group)<0)
+ if(H5Gclose(group)<0)
TEST_ERROR;
/* Create a dataset */
@@ -1925,7 +1925,7 @@ test_refer_dtype(hid_t file)
TEST_ERROR;
/* Create reference to named datatype */
- if(H5Rcreate(wbuf,file,"/Group1/Datatype1",H5R_OBJECT,-1)<0)
+ if(H5Rcreate(wbuf,file,"/Group1/Datatype1",H5R_OBJECT,-1)<0)
TEST_ERROR;
if(H5Rget_obj_type(dataset,H5R_OBJECT,wbuf)!=H5G_TYPE)
TEST_ERROR;
@@ -1937,7 +1937,7 @@ test_refer_dtype(hid_t file)
/* Close disk dataspace */
if(H5Sclose(sid1)<0)
TEST_ERROR;
-
+
/* Close Dataset */
if(H5Dclose(dataset)<0)
TEST_ERROR;
@@ -1958,7 +1958,7 @@ test_refer_dtype(hid_t file)
/* Check if the data type is equal */
if(!H5Tequal(native_type, H5T_STD_REF_OBJ))
TEST_ERROR;
-
+
/* Read selection from disk */
if(H5Dread(dataset,native_type,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf)<0)
TEST_ERROR;
@@ -1997,7 +1997,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_refer_dtype2
*
- * Purpose: Test H5Tget_native_type for reference
+ * Purpose: Test H5Tget_native_type for reference
*
* Return: Success: 0
*
@@ -2010,7 +2010,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_refer_dtype2(hid_t file)
{
hid_t dset1, /* Dataset ID */
@@ -2065,7 +2065,7 @@ test_refer_dtype2(hid_t file)
/* Create a reference dataset */
if((dset1=H5Dcreate(file,"Dataset1",H5T_STD_REF_DSETREG,sid1,H5P_DEFAULT))<0)
TEST_ERROR;
-
+
/* Create references */
/* Select 6x6 hyperslab for first reference */
start[0]=2; start[1]=2;
@@ -2092,7 +2092,7 @@ test_refer_dtype2(hid_t file)
/* Close disk dataspace */
if(H5Sclose(sid1)<0)
TEST_ERROR;
-
+
/* Close Dataset */
if(H5Dclose(dset1)<0)
TEST_ERROR;
@@ -2100,7 +2100,7 @@ test_refer_dtype2(hid_t file)
/* Close uint8 dataset dataspace */
if(H5Sclose(sid2)<0)
TEST_ERROR;
-
+
@@ -2156,7 +2156,7 @@ test_refer_dtype2(hid_t file)
TEST_ERROR;
if((int)H5Sget_select_hyper_nblocks(sid2) != 1)
TEST_ERROR;
-
+
/* Close region space */
if(H5Sclose(sid2)<0)
TEST_ERROR;
@@ -2177,10 +2177,10 @@ test_refer_dtype2(hid_t file)
free(dwbuf);
free(drbuf);
- PASSED();
- return 0;
-
-error:
+ PASSED();
+ return 0;
+
+error:
return -1;
} /* test_refer_dtype2() */
@@ -2209,7 +2209,7 @@ test_opaque_dtype(hid_t file)
size_t i;
unsigned char wbuf[32], rbuf[32];
hsize_t nelmts;
-
+
TESTING("opaque datatype");
/* opaque_1 */
@@ -2233,7 +2233,7 @@ test_opaque_dtype(hid_t file)
if((dataset=H5Dopen(file, DSET_OPAQUE_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0)
TEST_ERROR;
@@ -2241,7 +2241,7 @@ test_opaque_dtype(hid_t file)
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0)
TEST_ERROR;
-
+
for(i=0; i<sizeof(rbuf); i++) {
if (rbuf[i] != wbuf[i]) {
H5_FAILED();
@@ -2250,16 +2250,16 @@ test_opaque_dtype(hid_t file)
goto error;
}
}
-
+
if (H5Tclose(type)<0) TEST_ERROR;
if (H5Tclose(dtype)<0) TEST_ERROR;
if (H5Tclose(native_type)<0) TEST_ERROR;
if (H5Dclose(dataset)<0) TEST_ERROR;
- PASSED();
- return 0;
-
-error:
+ PASSED();
+ return 0;
+
+error:
return -1;
} /* test_opaque_dtype */
@@ -2288,7 +2288,7 @@ test_bitfield_dtype(hid_t file)
size_t i;
unsigned char wbuf[32];
hsize_t nelmts;
-
+
TESTING("bitfield datatype");
/* opaque_1 */
@@ -2311,7 +2311,7 @@ test_bitfield_dtype(hid_t file)
if((dataset=H5Dopen(file, DSET_BITFIELD_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
-
+
H5E_BEGIN_TRY {
native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT);
} H5E_END_TRY;
@@ -2325,10 +2325,10 @@ test_bitfield_dtype(hid_t file)
if (H5Tclose(dtype)<0) TEST_ERROR;
if (H5Dclose(dataset)<0) TEST_ERROR;
- PASSED();
- return 0;
-
-error:
+ PASSED();
+ return 0;
+
+error:
return -1;
} /* test_bitfield_dtype */
@@ -2349,7 +2349,7 @@ error:
* September 3, 2004
*
* Modifications:
- *
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2359,7 +2359,7 @@ test_ninteger(void)
hid_t fid2=(-1); /* file ID */
hid_t did1=(-1); /* dataset ID */
hid_t did2=(-1); /* dataset ID */
- hid_t sid1=(-1); /* dataspace ID */
+ hid_t sid1=(-1); /* dataspace ID */
hid_t dcpl1=(-1); /* dataset creation property list ID */
hid_t dcpl2=(-1); /* dataset creation property list ID */
hid_t tid1=(-1); /* file datatype */
@@ -2372,19 +2372,19 @@ test_ninteger(void)
int buf[DIM3];
int chk[DIM3];
int i;
-
+
for (i=0; i<DIM3; i++){
buf[i]=i;
}
-
+
TESTING("native integer ");
/*-------------------------------------------------------------------------
- * step1: create a file
+ * step1: create a file
*-------------------------------------------------------------------------
- */
+ */
/* create a file using default properties */
- if ((fid1=H5Fcreate("tstint1.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if ((fid1=H5Fcreate("tstint1.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto error;
/* create a data space */
@@ -2392,7 +2392,7 @@ test_ninteger(void)
/* create dcpl */
if((dcpl1 = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
-
+
/* create a dataset */
if ((did1 = H5Dcreate(fid1,"dset",H5T_NATIVE_INT,sid1,dcpl1)) <0) goto error;
@@ -2409,25 +2409,25 @@ test_ninteger(void)
/*-------------------------------------------------------------------------
* step 2: open and create another file copying the data from file1
*-------------------------------------------------------------------------
- */
-
+ */
+
/* open */
- if ((fid1=H5Fopen("tstint1.h5",H5F_ACC_RDONLY,H5P_DEFAULT))<0)
+ if ((fid1=H5Fopen("tstint1.h5",H5F_ACC_RDONLY,H5P_DEFAULT))<0)
goto error;
/* open dataset */
- if ((did1=H5Dopen(fid1,"dset"))<0)
+ if ((did1=H5Dopen(fid1,"dset"))<0)
goto error;
-
- if ((sid1=H5Dget_space(did1))<0)
+
+ if ((sid1=H5Dget_space(did1))<0)
goto error;
/* get dcpl */
- if ((dcpl1=H5Dget_create_plist(did1))<0)
+ if ((dcpl1=H5Dget_create_plist(did1))<0)
goto error;
/* get file datatype */
- if ((tid1=H5Dget_type (did1))<0)
+ if ((tid1=H5Dget_type (did1))<0)
goto error;
/* get native datatype */
@@ -2447,15 +2447,15 @@ test_ninteger(void)
if (H5Sget_simple_extent_dims(sid1,dims,NULL)<0)
goto error;
nelmts=1;
- for (i=0; i<rank; i++)
+ for (i=0; i<rank; i++)
nelmts*=dims[i];
-
+
/* read */
if (H5Dread(did1,nid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,chk)<0)
goto error;
/* create a file using default properties */
- if ((fid2=H5Fcreate("tstint2.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if ((fid2=H5Fcreate("tstint2.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto error;
/* create a dataset using the native type */
@@ -2466,11 +2466,11 @@ test_ninteger(void)
goto error;
/* get dcpl */
- if ((dcpl2=H5Dget_create_plist(did2))<0)
+ if ((dcpl2=H5Dget_create_plist(did2))<0)
goto error;
/* get file datatype */
- if ((tid2=H5Dget_type (did2))<0)
+ if ((tid2=H5Dget_type (did2))<0)
goto error;
/* get native datatype */
@@ -2498,7 +2498,7 @@ test_ninteger(void)
goto error;
}
}
-
+
/* close */
if (H5Sclose (sid1)<0) goto error;
if (H5Pclose (dcpl1)<0) goto error;
@@ -2511,11 +2511,11 @@ test_ninteger(void)
if (H5Dclose (did2)<0) goto error;
if (H5Fclose (fid1)<0) goto error;
if (H5Fclose (fid2)<0) goto error;
-
-
+
+
PASSED();
return 0;
-
+
error:
H5E_BEGIN_TRY {
H5Pclose(dcpl1);
@@ -2556,7 +2556,7 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
-
+
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;