diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-23 03:05:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-23 03:05:17 (GMT) |
commit | c0b228b1e402f10aee6125fe1f6b27c849e59f04 (patch) | |
tree | 3ee02b4e104678f8a835f3d58451db1f33df9108 /test | |
parent | e3f4d1c653da894b2bcade837ff32f7c9384bfa4 (diff) | |
download | hdf5-c0b228b1e402f10aee6125fe1f6b27c849e59f04.zip hdf5-c0b228b1e402f10aee6125fe1f6b27c849e59f04.tar.gz hdf5-c0b228b1e402f10aee6125fe1f6b27c849e59f04.tar.bz2 |
[svn-r9313] Purpose:
Bug fix.
Description:
Allow I/O to occur on 0 element selections.
Platforms tested:
h5committest
Diffstat (limited to 'test')
-rw-r--r-- | test/tselect.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tselect.c b/test/tselect.c index c74b90a..cdec45e 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -5023,6 +5023,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 */ @@ -5032,6 +5033,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++) @@ -5061,6 +5063,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"); @@ -5095,6 +5101,7 @@ test_select_none(void) /* Free memory buffers */ free(wbuf); + free(rbuf); } /* test_select_none() */ /**************************************************************** |