summaryrefslogtreecommitdiffstats
path: root/test/tselect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-09-23 03:05:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-09-23 03:05:15 (GMT)
commit9fc48a009786e78c1acf3ed7a5c74e1ef73e8b94 (patch)
treef357807db04a3f9fca8f4a207ab91b6392a24b8f /test/tselect.c
parentf235187dba7dfbef6a158340e1235c494303a9ad (diff)
downloadhdf5-9fc48a009786e78c1acf3ed7a5c74e1ef73e8b94.zip
hdf5-9fc48a009786e78c1acf3ed7a5c74e1ef73e8b94.tar.gz
hdf5-9fc48a009786e78c1acf3ed7a5c74e1ef73e8b94.tar.bz2
[svn-r9312] Purpose:
Bug fix. Description: Allow I/O to occur on 0 element selections. Platforms tested: h5committest
Diffstat (limited to 'test/tselect.c')
-rw-r--r--test/tselect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tselect.c b/test/tselect.c
index c1d985f..c4090f8 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -5374,6 +5374,7 @@ test_select_none(void)
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
uint8_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer to read from disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
herr_t ret; /* Generic return value */
@@ -5383,6 +5384,7 @@ test_select_none(void)
/* Allocate write & read buffers */
wbuf=malloc(sizeof(uint8_t)*SPACE7_DIM1*SPACE7_DIM2);
+ rbuf=malloc(sizeof(uint8_t)*SPACE7_DIM1*SPACE7_DIM2);
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
@@ -5412,6 +5414,10 @@ test_select_none(void)
ret = H5Sselect_none(sid2);
CHECK(ret, FAIL, "H5Sselect_none");
+ /* Attempt to read "nothing" from disk (before space is allocated) */
+ ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
/* Write "nothing" to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -5446,6 +5452,7 @@ test_select_none(void)
/* Free memory buffers */
free(wbuf);
+ free(rbuf);
} /* test_select_none() */
/****************************************************************