From 114ac60d1b210884bc96c4189ba4641f7844ef8c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 19 Oct 2000 15:53:07 -0500 Subject: [svn-r2708] Purpose: Add test case for contiguous hyperslabs. Platforms tested: FreeBSD 4.1.1 (hawkwind) --- test/tselect.c | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/test/tselect.c b/test/tselect.c index 15fcc26..12b922f 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -979,6 +979,135 @@ test_select_hyper_stride(void) /**************************************************************** ** +** test_select_hyper_contig(): Test H5S (dataspace) selection code. +** Tests contiguous hyperslabs of various sizes and dimensionalities. +** +****************************************************************/ +static void +test_select_hyper_contig(void) +{ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1}; + hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ + uint16_t *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temporary buffer pointer */ + intn i,j; /* Counters */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n")); + + /* Allocate write & read buffers */ + wbuf=malloc(sizeof(uint16_t)*SPACE2_DIM1*SPACE2_DIM2); + rbuf=calloc(sizeof(uint16_t),SPACE2_DIM1*SPACE2_DIM2); + + /* Initialize write buffer */ + for(i=0, tbuf=wbuf; i