summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-01-26 21:36:59 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-01-26 21:36:59 (GMT)
commit2528e7021fcd3ceceaf8bcee4cb477e741d0fac1 (patch)
tree651b99639ee7841dca52914de616a173139ed052 /test
parent2f60f824535c78b84060392d4854a6fcf86b5c59 (diff)
downloadhdf5-2528e7021fcd3ceceaf8bcee4cb477e741d0fac1.zip
hdf5-2528e7021fcd3ceceaf8bcee4cb477e741d0fac1.tar.gz
hdf5-2528e7021fcd3ceceaf8bcee4cb477e741d0fac1.tar.bz2
[svn-r20006] I updated the read buffer from float to double to be more appropriate.
Tested on jam and linew.
Diffstat (limited to 'test')
-rwxr-xr-xtest/cross_read.c12
-rwxr-xr-xtest/gen_cross.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/test/cross_read.c b/test/cross_read.c
index 78d6e7e..279d102 100755
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -61,6 +61,8 @@ static int read_data(char *fname)
hid_t dt;
float data_in[NX][NY]; /* input buffer */
float data_out[NX][NY]; /* output buffer */
+ double double_data_in[NX][NY]; /* input buffer */
+ double double_data_out[NX][NY]; /* output buffer */
int int_data_in[NX][NY]; /* input buffer */
int int_data_out[NX][NY]; /* output buffer */
int i, j;
@@ -159,8 +161,8 @@ static int read_data(char *fname)
*/
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++) {
- data_in[j][i] = ((double)(i + j + 1))/3;
- data_out[j][i] = 0;
+ double_data_in[j][i] = ((double)(i + j + 1))/3;
+ double_data_out[j][i] = 0;
}
}
@@ -177,17 +179,17 @@ static int read_data(char *fname)
* Read data from hyperslab in the file into the hyperslab in
* memory and display.
*/
- if(H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_out) < 0)
+ if(H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, double_data_out) < 0)
TEST_ERROR;
/* Check results */
for (j=0; j<NX; j++) {
for (i=0; i<NY; i++) {
- if (!DBL_REL_EQUAL(data_out[j][i], data_in[j][i], 0.001)) {
+ if (!DBL_REL_EQUAL(double_data_out[j][i], double_data_in[j][i], 0.001)) {
if (!nerrors++) {
H5_FAILED();
printf("element [%d][%d] is %g but should have been %g\n",
- j, i, data_out[j][i], data_in[j][i]);
+ j, i, double_data_out[j][i], double_data_in[j][i]);
}
}
}
diff --git a/test/gen_cross.c b/test/gen_cross.c
index 4bb585d..0bc3460 100755
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -44,7 +44,7 @@ int create_scale_offset_dset_int(hid_t fid, hid_t sid);
/*-------------------------------------------------------------------------
* Function: create_normal_dset
*
- * Purpose: Create a regular dataset of DOUBLE datatype.
+ * Purpose: Create a regular dataset of FLOAT datatype.
*
* Return: Success: 0
* Failure: -1