summaryrefslogtreecommitdiffstats
path: root/test/tcoords.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
commit5773fd34bc5adf59b4530d95ac9f0c0585902803 (patch)
tree456ad239799382e1f083fb7fc74399e43b471912 /test/tcoords.c
parent0138995d1ce2068db1f790503435a2121132d3ad (diff)
downloadhdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.zip
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.gz
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.bz2
[svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. New fortran wrappers added.
Diffstat (limited to 'test/tcoords.c')
-rw-r--r--test/tcoords.c306
1 files changed, 49 insertions, 257 deletions
diff --git a/test/tcoords.c b/test/tcoords.c
index 998a598..ab921d8 100644
--- a/test/tcoords.c
+++ b/test/tcoords.c
@@ -29,31 +29,21 @@
#define FILENAME "coord.h5"
-#define SINGLE_END_DSET "single_end_dset"
-#define MULTI_ENDS_SEL_HYPER_DSET "multiple_ends_dset"
-
-#define NAME_LEN 128
-
-/* Data written to the dataset for single block test. Global variable
- * for convenience. */
-int da_buffer[2][3][6][2];
-
/***********************************************************
**
-** test_singleEnd_selElements(): Test element selection of only
+** test_single_end(): Test full hyperslab selection of only
** one block.
**
*************************************************************/
-static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
+static void test_single_end(hid_t file)
{
hid_t sid, plid, did, msid;
- char dset_name[NAME_LEN]; /* Dataset name */
- size_t elmts_numb;
herr_t ret; /* Generic error return */
int i, j, k;
hsize_t da_dims[4] = { 2, 3, 6, 2 };
hsize_t da_chunksize[4] = { 1, 3, 3, 2 };
-
+ int da_buffer[2][3][6][2];
+
/* For testing the full selection in the fastest-growing end */
int mem1_buffer[1][1][6][2];
hsize_t mem1_dims[4] = { 1, 1, 6, 2 };
@@ -83,24 +73,10 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
/* For testing the full selection in the middle dimensions */
int mem3_buffer[1][3][6][1];
hsize_t mem3_dims[4] = { 1, 3, 6, 1 };
- hsize_t da_elmts3[18][4] = { {0, 0, 0, 0},
- {0, 0, 1, 0},
- {0, 0, 2, 0},
- {0, 0, 3, 0},
- {0, 0, 4, 0},
- {0, 0, 5, 0},
- {0, 1, 0, 0},
- {0, 1, 1, 0},
- {0, 1, 2, 0},
- {0, 1, 3, 0},
- {0, 1, 4, 0},
- {0, 1, 5, 0},
- {0, 2, 0, 0},
- {0, 2, 1, 0},
- {0, 2, 2, 0},
- {0, 2, 3, 0},
- {0, 2, 4, 0},
- {0, 2, 5, 0} };
+ hsize_t mem3_start[4] = { 0, 0, 0, 0 };
+ hsize_t mem3_count[4] = { 1, 1, 1, 1 };
+ hsize_t mem3_stride[4] = { 1, 1, 1, 1 };
+ hsize_t mem3_block[4] = { 1, 3, 6, 1 };
/* Create and write the dataset */
sid = H5Screate_simple(4, da_dims, da_dims);
@@ -109,26 +85,17 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
plid = H5Pcreate(H5P_DATASET_CREATE);
CHECK(plid, FAIL, "H5Pcreate");
- if(is_chunked) {
- ret = H5Pset_chunk(plid, 4, da_chunksize);
- CHECK(ret, FAIL, "H5Pset_chunk");
- }
-
- /* Construct dataset's name */
- memset(dset_name, 0, (size_t)NAME_LEN);
- strcat(dset_name, SINGLE_END_DSET);
- if(is_chunked)
- strcat(dset_name, "_chunked");
+ ret = H5Pset_chunk(plid, 4, da_chunksize);
+ CHECK(ret, FAIL, "H5Pset_chunk");
- did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
+ did = H5Dcreate2(file, "single_end", H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
- /* Initialize the data to be written to file */
for(i=0; i<2; i++) {
for(j=0; j<3; j++) {
for(k=0; k<6; k++) {
da_buffer[i][j][k][0] = i*100 + j*10 + k;
- da_buffer[i][j][k][1] = i*100 + j*10 + k + 1;
+ da_buffer[i][j][k][0] = i*100 + j*10 + k + 1;
}
}
}
@@ -142,16 +109,13 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
/* ****** Case 1: ******
* Testing the full selection in the fastest-growing end */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "single_end", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
- elmts_numb = 12;
-
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts1);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, 12, da_elmts1);
CHECK(ret, FAIL, "H5Sselect_elements");
- /* Dataspace for memory buffer */
msid = H5Screate_simple(4, mem1_dims, mem1_dims);
CHECK(msid, FAIL, "H5Screate_simple");
@@ -170,21 +134,18 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
for(i=0; i<6; i++)
for(j=0; j<2; j++)
if(da_buffer[0][0][i][j] != mem1_buffer[0][0][i][j]) {
- TestErrPrintf("%u: Read different values than written at index 0,0,%d,%d\n", __LINE__, i, j);
+ TestErrPrintf("Read different values than written at index 0,0,%d,%d\n", i, j);
}
/* ****** Case 2: ******
* Testing the full selection in the slowest-growing end */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "single_end", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
- elmts_numb = 6;
-
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts2);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, 6, da_elmts2);
CHECK(ret, FAIL, "H5Sselect_elements");
- /* Dataspace for memory buffer */
msid = H5Screate_simple(4, mem2_dims, mem2_dims);
CHECK(msid, FAIL, "H5Screate_simple");
@@ -203,21 +164,18 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
for(i=0; i<2; i++)
for(j=0; j<3; j++)
if(da_buffer[i][j][0][0] != mem2_buffer[i][j][0][0]) {
- TestErrPrintf("%u: Read different values than written at index %d,%d,0,0, da_buffer = %d, mem2_buffer = %d\n", __LINE__, i, j, da_buffer[i][j][0][0], mem2_buffer[i][j][0][0]);
+ TestErrPrintf("Read different values than written at index %d,%d,0,0\n", i, j);
}
/* ****** Case 3: ******
* Testing the full selection in the middle dimensions */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "single_end", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
- elmts_numb = 18;
-
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts3);
- CHECK(ret, FAIL, "H5Sselect_elements");
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem3_start, mem3_stride, mem3_count, mem3_block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Dataspace for memory buffer */
msid = H5Screate_simple(4, mem3_dims, mem3_dims);
CHECK(msid, FAIL, "H5Screate_simple");
@@ -236,7 +194,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
for(i=0; i<3; i++)
for(j=0; j<6; j++)
if(da_buffer[0][i][j][0] != mem3_buffer[0][i][j][0]) {
- TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0\n", __LINE__, i, j);
+ TestErrPrintf("Read different values than written at index 0,%d,%d,0\n", i, j);
}
@@ -247,153 +205,6 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
CHECK(ret, FAIL, "H5Pclose");
}
-/***********************************************************
-**
-** test_singleEnd_selHyperslab(): Test full hyperslab selection
-** of only one block.
-**
-*************************************************************/
-static void test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked)
-{
- hid_t sid, did, msid;
- char dset_name[NAME_LEN]; /* Dataset name */
- herr_t ret; /* Generic error return */
- int i, j;
- hsize_t da_dims[4] = { 2, 3, 6, 2 };
-
- /* For testing the full selection in the fastest-growing end */
- int mem1_buffer[1][1][6][2];
- hsize_t mem1_dims[4] = { 1, 1, 6, 2 };
- hsize_t mem1_start[4] = { 0, 0, 0, 0 };
- hsize_t mem1_count[4] = { 1, 1, 1, 1 };
- hsize_t mem1_stride[4] = { 1, 1, 1, 1 };
- hsize_t mem1_block[4] = { 1, 1, 6, 2 };
-
- /* For testing the full selection in the slowest-growing end */
- int mem2_buffer[2][3][1][1];
- hsize_t mem2_dims[4] = { 2, 3, 1, 1 };
- hsize_t mem2_start[4] = { 0, 0, 0, 0 };
- hsize_t mem2_count[4] = { 1, 1, 1, 1 };
- hsize_t mem2_stride[4] = { 1, 1, 1, 1 };
- hsize_t mem2_block[4] = { 2, 3, 1, 1 };
-
- /* For testing the full selection in the middle dimensions */
- int mem3_buffer[1][3][6][1];
- hsize_t mem3_dims[4] = { 1, 3, 6, 1 };
- hsize_t mem3_start[4] = { 0, 0, 0, 0 };
- hsize_t mem3_count[4] = { 1, 1, 1, 1 };
- hsize_t mem3_stride[4] = { 1, 1, 1, 1 };
- hsize_t mem3_block[4] = { 1, 3, 6, 1 };
-
- /* Construct dataset's name */
- memset(dset_name, 0, NAME_LEN);
- strcat(dset_name, SINGLE_END_DSET);
- if(is_chunked)
- strcat(dset_name, "_chunked");
-
- /* Dataspace for the dataset in file */
- sid = H5Screate_simple(4, da_dims, da_dims);
- CHECK(sid, FAIL, "H5Screate_simple");
-
- /* ****** Case 1: ******
- * Testing the full selection in the fastest-growing end */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen");
-
- /* Select the elements in the dataset */
- ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem1_start, mem1_stride, mem1_count, mem1_block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- /* Dataspace for memory buffer */
- msid = H5Screate_simple(4, mem1_dims, mem1_dims);
- CHECK(msid, FAIL, "H5Screate_simple");
-
- ret = H5Sselect_all(msid);
- CHECK(ret, FAIL, "H5Sselect_all");
-
- ret = H5Dread(did, H5T_NATIVE_INT, msid, sid, H5P_DEFAULT, mem1_buffer);
- CHECK(ret, FAIL, "H5Dread");
-
- ret = H5Dclose(did);
- CHECK(ret, FAIL, "H5Dclose");
-
- ret = H5Sclose(msid);
- CHECK(ret, FAIL, "H5Sclose");
-
- for(i=0; i<6; i++)
- for(j=0; j<2; j++)
- if(da_buffer[0][0][i][j] != mem1_buffer[0][0][i][j]) {
- TestErrPrintf("%u: Read different values than written at index 0,0,%d,%d\n", __LINE__, i, j);
- }
-
- /* ****** Case 2: ******
- * Testing the full selection in the slowest-growing end */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen");
-
- /* Select the elements in the dataset */
- ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem2_start, mem2_stride, mem2_count, mem2_block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- /* Dataspace for memory buffer */
- msid = H5Screate_simple(4, mem2_dims, mem2_dims);
- CHECK(msid, FAIL, "H5Screate_simple");
-
- ret = H5Sselect_all(msid);
- CHECK(ret, FAIL, "H5Sselect_all");
-
- ret = H5Dread(did, H5T_NATIVE_INT, msid, sid, H5P_DEFAULT, mem2_buffer);
- CHECK(ret, FAIL, "H5Dread");
-
- ret = H5Dclose(did);
- CHECK(ret, FAIL, "H5Dclose");
-
- ret = H5Sclose(msid);
- CHECK(ret, FAIL, "H5Sclose");
-
- for(i=0; i<2; i++)
- for(j=0; j<3; j++)
- if(da_buffer[i][j][0][0] != mem2_buffer[i][j][0][0]) {
- TestErrPrintf("%u: Read different values than written at index %d,%d,0,0\n", __LINE__, i, j);
- }
-
- /* ****** Case 3: ******
- * Testing the full selection in the middle dimensions */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen");
-
- /* Select the elements in the dataset */
- ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem3_start, mem3_stride, mem3_count, mem3_block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- /* Dataspace for memory buffer */
- msid = H5Screate_simple(4, mem3_dims, mem3_dims);
- CHECK(msid, FAIL, "H5Screate_simple");
-
- ret = H5Sselect_all(msid);
- CHECK(ret, FAIL, "H5Sselect_all");
-
- ret = H5Dread(did, H5T_NATIVE_INT, msid, sid, H5P_DEFAULT, mem3_buffer);
- CHECK(ret, FAIL, "H5Dread");
-
- ret = H5Dclose(did);
- CHECK(ret, FAIL, "H5Dclose");
-
- ret = H5Sclose(msid);
- CHECK(ret, FAIL, "H5Sclose");
-
- for(i=0; i<3; i++)
- for(j=0; j<6; j++)
- if(da_buffer[0][i][j][0] != mem3_buffer[0][i][j][0]) {
- TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0\n", __LINE__, i, j);
- }
-
-
- ret = H5Sclose(sid);
- CHECK(ret, FAIL, "H5Sclose");
-}
-
-
/***********************************************************
**
@@ -401,15 +212,14 @@ static void test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked)
** multiple blocks.
**
*************************************************************/
-static void test_multiple_ends(hid_t file, hbool_t is_chunked)
+static void test_multiple_ends(hid_t file)
{
hid_t sid, plid, did, msid;
- char dset_name[NAME_LEN]; /* Dataset name */
herr_t ret; /* Generic error return */
int i, j, k, l, m, n, p;
hsize_t da_dims[8] = { 4, 5, 3, 4, 2, 3, 6, 2 };
hsize_t da_chunksize[8] = { 1, 5, 3, 2, 2, 3, 3, 2 };
- int data_buf[4][5][3][4][2][3][6][2];
+ int da_buffer[4][5][3][4][2][3][6][2];
/* For testing the full selections in the fastest-growing end and in the middle dimensions */
int mem1_buffer[1][1][1][4][2][1][6][2];
@@ -459,18 +269,10 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
plid = H5Pcreate(H5P_DATASET_CREATE);
CHECK(plid, FAIL, "H5Pcreate");
- if(is_chunked) {
- ret = H5Pset_chunk(plid, 8, da_chunksize);
- CHECK(ret, FAIL, "H5Pset_chunk");
- }
+ ret = H5Pset_chunk(plid, 8, da_chunksize);
+ CHECK(ret, FAIL, "H5Pset_chunk");
- /* Construct dataset's name */
- memset(dset_name, 0, NAME_LEN);
- strcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET);
- if(is_chunked)
- strcat(dset_name, "_chunked");
-
- did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
+ did = H5Dcreate2(file, "multiple_ends", H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
for(i=0; i<4; i++)
@@ -480,11 +282,11 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(m=0; m<2; m++)
for(n=0; n<3; n++)
for(p=0; p<6; p++) {
- data_buf[i][j][k][l][m][n][p][0] = i*1000000 + j*100000 + k*10000 + l*1000 + m*100 + n*10 + p;
- data_buf[i][j][k][l][m][n][p][1] = i*1000000 + j*100000 + k*10000 + l*1000 + m*100 + n*10 + p + 1;
+ da_buffer[i][j][k][l][m][n][p][0] = i*1000000 + j*100000 + k*10000 + l*1000 + m*100 + n*10 + p;
+ da_buffer[i][j][k][l][m][n][p][1] = i*1000000 + j*100000 + k*10000 + l*1000 + m*100 + n*10 + p + 1;
}
- ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data_buf);
+ ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, da_buffer);
CHECK(ret, FAIL, "H5Dwrite");
ret = H5Dclose(did);
@@ -492,7 +294,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
/* ****** Case 1: ******
* Testing the full selections in the fastest-growing end and in the middle dimensions*/
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "multiple_ends", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
@@ -518,13 +320,13 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(j=0; j<2; j++)
for(k=0; k<6; k++)
for(l=0; l<2; l++)
- if(data_buf[0][0][0][i][j][0][k][l] != mem1_buffer[0][0][0][i][j][0][k][l]) {
- TestErrPrintf("%u: Read different values than written at index 0,0,0,%d,%d,0,%d,%d\n", __LINE__, i, j, k, l);
+ if(da_buffer[0][0][0][i][j][0][k][l] != mem1_buffer[0][0][0][i][j][0][k][l]) {
+ TestErrPrintf("Read different values than written at index 0,0,0,%d,%d,0,%d,%d\n", i, j, k, l);
}
/* ****** Case 2: ******
* Testing the full selections in the slowest-growing end and in the middle dimensions*/
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "multiple_ends", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
@@ -550,13 +352,13 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(j=0; j<5; j++)
for(k=0; k<4; k++)
for(l=0; l<2; l++)
- if(data_buf[i][j][0][k][l][0][0][0] != mem2_buffer[i][j][0][k][l][0][0][0]) {
- TestErrPrintf("%u: Read different values than written at index %d,%d,0,%d,%d,0,0,0\n", __LINE__, i, j, k, l);
+ if(da_buffer[i][j][0][k][l][0][0][0] != mem2_buffer[i][j][0][k][l][0][0][0]) {
+ TestErrPrintf("Read different values than written at index %d,%d,0,%d,%d,0,0,0\n", i, j, k, l);
}
/* ****** Case 3: ******
* Testing two unadjacent full selections in the middle dimensions */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "multiple_ends", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
@@ -582,13 +384,13 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(j=0; j<3; j++)
for(k=0; k<3; k++)
for(l=0; l<6; l++)
- if(data_buf[0][i][j][0][0][k][l][0] != mem3_buffer[0][i][j][0][0][k][l][0]) {
- TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0,0,%d,%d,0\n", __LINE__, i, j, k, l);
+ if(da_buffer[0][i][j][0][0][k][l][0] != mem3_buffer[0][i][j][0][0][k][l][0]) {
+ TestErrPrintf("Read different values than written at index 0,%d,%d,0,0,%d,%d,0\n", i, j, k, l);
}
/* ****** Case 4: ******
* Testing the full selections in the fastest-growing end and the slowest-growing end */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "multiple_ends", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
@@ -614,15 +416,15 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(j=0; j<5; j++)
for(k=0; k<6; k++)
for(l=0; l<2; l++)
- if(data_buf[i][j][0][0][0][0][k][l] != mem4_buffer[i][j][0][0][0][0][k][l]) {
- TestErrPrintf("%u: Read different values than written at index %d,%d,0,0,0,0,%d,%d\n", __LINE__, i, j, k, l);
+ if(da_buffer[i][j][0][0][0][0][k][l] != mem4_buffer[i][j][0][0][0][0][k][l]) {
+ TestErrPrintf("Read different values than written at index %d,%d,0,0,0,0,%d,%d\n", i, j, k, l);
}
/* ****** Case 5: ******
* Testing the full selections in the fastest-growing end and the slowest-growing end,
* and also in the middle dimensions */
- did = H5Dopen2(file, dset_name, H5P_DEFAULT);
+ did = H5Dopen2(file, "multiple_ends", H5P_DEFAULT);
CHECK(did, FAIL, "H5Dopen");
/* Select the elements in the dataset */
@@ -650,8 +452,8 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
for(l=0; l<2; l++)
for(m=0; m<6; m++)
for(n=0; n<2; n++)
- if(data_buf[i][j][0][k][l][0][m][n] != mem5_buffer[i][j][0][k][l][0][m][n]) {
- TestErrPrintf("%u: Read different values than written at index %d,%d,0,%d,%d,0,%d,%d\n", __LINE__, i, j, k, l, m, n);
+ if(da_buffer[i][j][0][k][l][0][m][n] != mem5_buffer[i][j][0][k][l][0][m][n]) {
+ TestErrPrintf("Read different values than written at index %d,%d,0,%d,%d,0,%d,%d\n", i, j, k, l, m, n);
}
@@ -670,24 +472,14 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
****************************************************************/
void test_coords(void)
{
- hid_t fid;
- int i;
- hbool_t is_chunk;
- herr_t ret; /* Generic error return */
+ hid_t fid;
+ herr_t ret; /* Generic error return */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
- for(i=0, is_chunk=FALSE; i<2; i++, is_chunk++) {
- /* Test H5Sselect_elements with selection of one block of data */
- test_singleEnd_selElements(fid, is_chunk);
-
- /* Test H5Sselect_hyperslab with selection of one block of data */
- test_singleEnd_selHyperslab(fid, is_chunk);
-
- /* Test H5Sselect_hyperslab with selection of multiple blocks of data */
- test_multiple_ends(fid, is_chunk);
- }
+ test_single_end(fid);
+ test_multiple_ends(fid);
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");