From 0aad682d197da6ef1247ca92de83228b8ebebb8a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 25 Jun 1999 15:19:07 -0500 Subject: [svn-r1387] Added tests for the "all" and "none" selection iterators. --- test/tselect.c | 59 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/test/tselect.c b/test/tselect.c index 195265a..1e72d0f 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -64,6 +64,8 @@ int compare_size_t(const void *s1, const void *s2); herr_t test_select_hyper_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); herr_t test_select_point_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); +herr_t test_select_all_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); +herr_t test_select_none_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); /**************************************************************** ** @@ -376,6 +378,38 @@ test_select_point(void) /**************************************************************** ** +** test_select_all_iter1(): Iterator for checking all iteration +** +** +****************************************************************/ +herr_t +test_select_all_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *_operator_data) +{ + uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ + **tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */ + + if(*tbuf!=**tbuf2) + return(-1); + else { + (*tbuf2)++; + return(0); + } +} /* end test_select_all_iter1() */ + +/**************************************************************** +** +** test_select_none_iter1(): Iterator for checking none iteration +** (This is never supposed to be called, so it always returns -1) +** +****************************************************************/ +herr_t +test_select_none_iter1(void UNUSED *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void UNUSED *_operator_data) +{ + return(-1); +} /* end test_select_none_iter1() */ + +/**************************************************************** +** ** test_select_all(): Test basic H5S (dataspace) selection code. ** Tests "all" selections. ** @@ -395,8 +429,7 @@ test_select_all(void) hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ - *tbuf, /* temporary buffer pointer */ - *tbuf2; /* temporary buffer pointer */ + *tbuf; /* temporary buffer pointer */ intn i,j; /* Counters */ herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ @@ -480,16 +513,16 @@ test_select_all(void) ret=H5Dread(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,rbuf); CHECK(ret, FAIL, "H5Dread"); - /* Compare data read with data written out */ - for(i=0; i