summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-04-24 15:03:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-04-24 15:03:41 (GMT)
commit495ca9c7bb19553d2c87ce68013f1de2dff3d54b (patch)
tree792e1a9ecc8aa314dfa3d0538464e4f87ad55cf5 /test
parent16d4cae5b16ffb91298d8d232214afeb5112da6d (diff)
downloadhdf5-495ca9c7bb19553d2c87ce68013f1de2dff3d54b.zip
hdf5-495ca9c7bb19553d2c87ce68013f1de2dff3d54b.tar.gz
hdf5-495ca9c7bb19553d2c87ce68013f1de2dff3d54b.tar.bz2
[svn-r14860] Description:
Omnibus raw data I/O revisions, with wide-ranging changes and refactoring, in order to prepare for implementing "fast append" feature. These changes remove the majority of the code duplication for raw data I/O which has crept in over the last ten years and introduces a more object- oriented design for operating on different types of dataset storage. Chunked storage no longer has it's own I/O routines, it is now handled as either contiguous (if chunk is not pulled into the cache) or compact (if the chunk is cached in memory). No bug or feature changes, at least intentionally... :-) Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.5.2 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'test')
-rw-r--r--test/cmpd_dset.c46
-rw-r--r--test/tcoords.c28
-rw-r--r--test/th5s.c6
3 files changed, 40 insertions, 40 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 66993e0..a03d37e 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -1421,32 +1421,32 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Create xfer properties to preserve initialized data */
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Pset_preserve(dxpl, TRUE) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Rewrite contiguous data set */
if((dataset = H5Dopen2(file, DSET_NAME[0], H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Rewrite chunked data set */
if((dataset = H5Dopen2(file, DSET_NAME[1], H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Write the data to the dataset */
if(H5Dwrite(dataset, rew_tid, H5S_ALL, H5S_ALL, dxpl, rew_buf) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
- goto error;
+ FAIL_STACK_ERROR
PASSED();
@@ -1458,48 +1458,48 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
/* Check contiguous data set */
if((dataset = H5Dopen2(file, DSET_NAME[0], H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Dread(dataset, dst_tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(compare_data(orig, rbuf, TRUE) < 0)
- goto error;
+ TEST_ERROR
if(H5Dclose(dataset) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Check chunked data set */
if((dataset = H5Dopen2(file, DSET_NAME[1], H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Dread(dataset, dst_tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(compare_data(orig, rbuf, TRUE) < 0)
- goto error;
+ TEST_ERROR
if(H5Dclose(dataset) < 0)
- goto error;
+ FAIL_STACK_ERROR
/* Finishing test and release resources */
if(H5Sclose(space) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Pclose(dcpl) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Pclose(dxpl) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Tclose(src_tid) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Tclose(dst_tid) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Tclose(rew_tid) < 0)
- goto error;
+ FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
- goto error;
+ FAIL_STACK_ERROR
free(orig);
free(rbuf);
diff --git a/test/tcoords.c b/test/tcoords.c
index c9d4316..998a598 100644
--- a/test/tcoords.c
+++ b/test/tcoords.c
@@ -148,7 +148,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
/* Select the elements in the dataset */
elmts_numb = 12;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, da_elmts1);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Dataspace for memory buffer */
@@ -170,7 +170,7 @@ 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("Read different values than written at index 0,0,%d,%d\n", i, j);
+ TestErrPrintf("%u: Read different values than written at index 0,0,%d,%d\n", __LINE__, i, j);
}
/* ****** Case 2: ******
@@ -181,7 +181,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
/* Select the elements in the dataset */
elmts_numb = 6;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, da_elmts2);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Dataspace for memory buffer */
@@ -203,7 +203,7 @@ 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("Read different values than written at index %d,%d,0,0\n", i, j);
+ 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]);
}
/* ****** Case 3: ******
@@ -214,7 +214,7 @@ static void test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
/* Select the elements in the dataset */
elmts_numb = 18;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, da_elmts3);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, elmts_numb, (const hsize_t *)da_elmts3);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Dataspace for memory buffer */
@@ -236,7 +236,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("Read different values than written at index 0,%d,%d,0\n", i, j);
+ TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0\n", __LINE__, i, j);
}
@@ -323,7 +323,7 @@ static void test_singleEnd_selHyperslab(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("Read different values than written at index 0,0,%d,%d\n", i, j);
+ TestErrPrintf("%u: Read different values than written at index 0,0,%d,%d\n", __LINE__, i, j);
}
/* ****** Case 2: ******
@@ -354,7 +354,7 @@ static void test_singleEnd_selHyperslab(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("Read different values than written at index %d,%d,0,0\n", i, j);
+ TestErrPrintf("%u: Read different values than written at index %d,%d,0,0\n", __LINE__, i, j);
}
/* ****** Case 3: ******
@@ -385,7 +385,7 @@ static void test_singleEnd_selHyperslab(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("Read different values than written at index 0,%d,%d,0\n", i, j);
+ TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0\n", __LINE__, i, j);
}
@@ -519,7 +519,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
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("Read different values than written at index 0,0,0,%d,%d,0,%d,%d\n", i, j, 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);
}
/* ****** Case 2: ******
@@ -551,7 +551,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
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("Read different values than written at index %d,%d,0,%d,%d,0,0,0\n", i, j, k, l);
+ TestErrPrintf("%u: Read different values than written at index %d,%d,0,%d,%d,0,0,0\n", __LINE__, i, j, k, l);
}
/* ****** Case 3: ******
@@ -583,7 +583,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
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("Read different values than written at index 0,%d,%d,0,0,%d,%d,0\n", i, j, k, l);
+ TestErrPrintf("%u: Read different values than written at index 0,%d,%d,0,0,%d,%d,0\n", __LINE__, i, j, k, l);
}
/* ****** Case 4: ******
@@ -615,7 +615,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
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("Read different values than written at index %d,%d,0,0,0,0,%d,%d\n", i, j, 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);
}
@@ -651,7 +651,7 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
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("Read different values than written at index %d,%d,0,%d,%d,0,%d,%d\n", i, j, k, l, 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);
}
diff --git a/test/th5s.c b/test/th5s.c
index 983838e..5bf7845 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -378,7 +378,7 @@ test_h5s_null(void)
hsize_t coord[1][1]; /* Coordinates for point selection */
coord[0][0]=0;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, coord);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
@@ -1055,8 +1055,8 @@ test_h5s_chunk(void)
for(i=0; i<50000; i++) {
for(j=0; j<3; j++) {
/* Check if the two values are within 0.001% range. */
- if(!DBL_REL_EQUAL(chunk_data_dbl[i][j],chunk_data_flt[i][j], 0.00001))
- TestErrPrintf("chunk_data_dbl[%d][%d]=%f, chunk_data_flt[%d][%d]=%f\n",i,j,chunk_data_dbl[i][j],i,j,chunk_data_flt[i][j]);
+ if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001))
+ TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, chunk_data_flt[i][j]);
} /* end for */
} /* end for */
} /* test_h5s_chunk() */