summaryrefslogtreecommitdiffstats
path: root/test/tselect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-20 17:11:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-20 17:11:36 (GMT)
commit00909f278d64017c21c8348537231daba97be9dd (patch)
treebf17a4086979f776a008aa4606fea1b3e7a5edb8 /test/tselect.c
parent129f72fb3ed868fab0fa1cd71854aa1aad366336 (diff)
downloadhdf5-00909f278d64017c21c8348537231daba97be9dd.zip
hdf5-00909f278d64017c21c8348537231daba97be9dd.tar.gz
hdf5-00909f278d64017c21c8348537231daba97be9dd.tar.bz2
[svn-r8901] Purpose:
Bug fix Description: Allow buffer parameter to H5Dread & H5Dwrite to be NULL if there are no elements to transfer. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'test/tselect.c')
-rw-r--r--test/tselect.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/tselect.c b/test/tselect.c
index 228002c..c1d985f 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -253,6 +253,12 @@ test_select_hyper(hid_t xfer_plist)
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf);
CHECK(ret, FAIL, "H5Dwrite");
+ /* Exercise check for NULL buffer and valid selection */
+ H5E_BEGIN_TRY {
+ ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,NULL);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dwrite");
+
/* Close memory dataspace */
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
@@ -273,6 +279,12 @@ test_select_hyper(hid_t xfer_plist)
ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,rbuf);
CHECK(ret, FAIL, "H5Dread");
+ /* Exercise check for NULL buffer and valid selection */
+ H5E_BEGIN_TRY {
+ ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,NULL);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dread");
+
/* Check that the values match with a dataset iterator */
tbuf=wbuf+(15*SPACE2_DIM2);
ret = H5Diterate(rbuf,H5T_NATIVE_UCHAR,sid2,test_select_hyper_iter1,&tbuf);
@@ -5408,6 +5420,14 @@ test_select_none(void)
ret=H5Dwrite(dataset,H5T_NATIVE_INT,sid2,sid1,H5P_DEFAULT,wbuf);
CHECK(ret, FAIL, "H5Dwrite");
+ /* Write "nothing" to disk (with NULL buffer argument) */
+ ret=H5Dwrite(dataset,H5T_NATIVE_INT,sid2,sid1,H5P_DEFAULT,NULL);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Read "nothing" from disk (with NULL buffer argument) */
+ ret=H5Dread(dataset,H5T_NATIVE_INT,sid2,sid1,H5P_DEFAULT,NULL);
+ CHECK(ret, FAIL, "H5Dread");
+
/* Close memory dataspace */
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");