summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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");