mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r14389] Changed some test cases to use H5Sselect_elements instead of H5Sselect_hyperslab for test
purpose. Tested on smirom only. Simple changes.
This commit is contained in:
parent
b58ac6c8ee
commit
0545c915c3
@ -45,18 +45,28 @@ static void test_single_end(hid_t file)
|
||||
/* For testing the full selection in the fastest-growing end */
|
||||
int mem1_buffer[1][1][6][2];
|
||||
hsize_t mem1_dims[4] = { 1, 1, 6, 2 };
|
||||
hsize_t mem1_start[4] = { 0, 0, 0, 0 };
|
||||
hsize_t mem1_count[4] = { 1, 1, 1, 1 };
|
||||
hsize_t mem1_stride[4] = { 1, 1, 1, 1 };
|
||||
hsize_t mem1_block[4] = { 1, 1, 6, 2 };
|
||||
hsize_t da_elmts1[12][4] = { {0, 0, 0, 0},
|
||||
{0, 0, 0, 1},
|
||||
{0, 0, 1, 0},
|
||||
{0, 0, 1, 1},
|
||||
{0, 0, 2, 0},
|
||||
{0, 0, 2, 1},
|
||||
{0, 0, 3, 0},
|
||||
{0, 0, 3, 1},
|
||||
{0, 0, 4, 0},
|
||||
{0, 0, 4, 1},
|
||||
{0, 0, 5, 0},
|
||||
{0, 0, 5, 1} };
|
||||
|
||||
/* For testing the full selection in the slowest-growing end */
|
||||
int mem2_buffer[2][3][1][1];
|
||||
hsize_t mem2_dims[4] = { 2, 3, 1, 1 };
|
||||
hsize_t mem2_start[4] = { 0, 0, 0, 0 };
|
||||
hsize_t mem2_count[4] = { 1, 1, 1, 1 };
|
||||
hsize_t mem2_stride[4] = { 1, 1, 1, 1 };
|
||||
hsize_t mem2_block[4] = { 2, 3, 1, 1 };
|
||||
hsize_t da_elmts2[6][4] = { {0, 0, 0, 0},
|
||||
{0, 1, 0, 0},
|
||||
{0, 2, 0, 0},
|
||||
{1, 0, 0, 0},
|
||||
{1, 1, 0, 0},
|
||||
{1, 2, 0, 0} };
|
||||
|
||||
/* For testing the full selection in the middle dimensions */
|
||||
int mem3_buffer[1][3][6][1];
|
||||
@ -101,8 +111,8 @@ static void test_single_end(hid_t file)
|
||||
CHECK(did, FAIL, "H5Dopen");
|
||||
|
||||
/* Select the elements in the dataset */
|
||||
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem1_start, mem1_stride, mem1_count, mem1_block);
|
||||
CHECK(ret, FAIL, "H5Sselect_hyperslab");
|
||||
ret = H5Sselect_elements(sid, H5S_SELECT_SET, 12, (const hsize_t**)da_elmts1);
|
||||
CHECK(ret, FAIL, "H5Sselect_elements");
|
||||
|
||||
msid = H5Screate_simple(4, mem1_dims, mem1_dims);
|
||||
CHECK(msid, FAIL, "H5Screate_simple");
|
||||
@ -131,8 +141,8 @@ static void test_single_end(hid_t file)
|
||||
CHECK(did, FAIL, "H5Dopen");
|
||||
|
||||
/* Select the elements in the dataset */
|
||||
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, mem2_start, mem2_stride, mem2_count, mem2_block);
|
||||
CHECK(ret, FAIL, "H5Sselect_hyperslab");
|
||||
ret = H5Sselect_elements(sid, H5S_SELECT_SET, 6, (const hsize_t**)da_elmts2);
|
||||
CHECK(ret, FAIL, "H5Sselect_elements");
|
||||
|
||||
msid = H5Screate_simple(4, mem2_dims, mem2_dims);
|
||||
CHECK(msid, FAIL, "H5Screate_simple");
|
||||
|
Loading…
Reference in New Issue
Block a user