diff options
Diffstat (limited to 'test/tselect.c')
-rw-r--r-- | test/tselect.c | 2725 |
1 files changed, 2166 insertions, 559 deletions
diff --git a/test/tselect.c b/test/tselect.c index 0637c33..770b78a 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -176,6 +176,13 @@ #define SEL_ITER_MAX_SEQ 256 +/* Defines for test_hyper_io_1d() */ +#define DNAME "DSET_1D" +#define RANK 1 +#define NUMCHUNKS 3 +#define CHUNKSZ 20 +#define NUM_ELEMENTS NUMCHUNKS * CHUNKSZ + /* Location comparison function */ static int compare_size_t(const void *s1, const void *s2); @@ -1661,7 +1668,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, ** test_select_hyper_contig_dr__run_test(): Test H5S (dataspace) ** selection code with contiguous source and target having ** different ranks but the same shape. We have already -** tested H5S_select_shape_same in isolation, so now we try to do +** tested H5Sselect_shape_same in isolation, so now we try to do ** I/O. ** ****************************************************************/ @@ -1845,11 +1852,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* first, verify that we can read from disk correctly using selections - * of different rank that H5S_select_shape_same() views as being of the + * of different rank that H5Sselect_shape_same() views as being of the * same shape. * * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * verifying that the data read is correct. Verify that H5Sselect_shape_same() * returns true on the memory and file selections. */ @@ -1893,12 +1900,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, block_ptr); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Read selection from disk */ ret = H5Dread(large_cube_dataset, @@ -1970,12 +1976,11 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Read selection from disk */ @@ -2037,12 +2042,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* now we go in the opposite direction, verifying that we can write * from memory to file using selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * H5Sselect_shape_same() views as being of the same shape. * * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5Sselect_shape_same() returns true on the * memory and file selections. */ @@ -2086,13 +2091,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in + /* verify that H5Sselect_shape_same() reports the in * memory slice through the cube selection and the * on disk full small cube selections as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* write the slice from the in memory large cube to the on disk small cube */ @@ -2144,7 +2148,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, /* Now write the contents of the in memory small cube to slices of * the on disk cube. After each write, read the on disk cube * into memeory, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on + * data. Verify that H5Sselect_shape_same() returns true on * the memory and file selections. */ @@ -2196,14 +2200,13 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, CHECK(ret, FAIL, "H5Sselect_hyperslab"); - /* verify that H5S_select_shape_same() reports the in + /* verify that H5Sselect_shape_same() reports the in * memory full selection of the small cube and the * on disk slice through the large cube selection * as having the same shape. */ - check = H5S_select_shape_same_test(small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* write the cube from memory to the target slice of the disk cube */ @@ -2308,7 +2311,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, ** test_select_hyper_contig_dr(): Test H5S (dataspace) ** selection code with contiguous source and target having ** different ranks but the same shape. We have already -** tested H5S_select_shape_same in isolation, so now we try to do +** tested H5Sselect_shape_same in isolation, so now we try to do ** I/O. ** ****************************************************************/ @@ -2731,7 +2734,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr, ** test_select_hyper_checker_board_dr__run_test(): Test H5S ** (dataspace) selection code with checker board source and ** target selections having different ranks but the same -** shape. We have already tested H5S_select_shape_same in +** shape. We have already tested H5Sselect_shape_same in ** isolation, so now we try to do I/O. ** ****************************************************************/ @@ -2937,11 +2940,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* first, verify that we can read from disk correctly using selections - * of different rank that H5S_select_shape_same() views as being of the + * of different rank that H5Sselect_shape_same() views as being of the * same shape. * * Start by reading small_rank-D slice from the on disk large cube, and - * verifying that the data read is correct. Verify that H5S_select_shape_same() + * verifying that the data read is correct. Verify that H5Sselect_shape_same() * returns true on the memory and file selections. * * The first step is to set up the needed checker board selection in the @@ -3003,12 +3006,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(mem_small_cube_sid, - file_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mem_small_cube_sid, file_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* zero the buffer that we will be using for reading */ HDmemset(small_cube_buf_1, 0, sizeof(*small_cube_buf_1) * small_cube_size); @@ -3110,12 +3112,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(file_small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* zero out the in memory large cube */ @@ -3194,12 +3195,12 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ /* now we go in the opposite direction, verifying that we can write * from memory to file using selections of different rank that - * H5S_select_shape_same() views as being of the same shape. + * H5Sselect_shape_same() views as being of the same shape. * * Start by writing small_rank D slices from the in memory large cube, to * the the on disk small cube dataset. After each write, read the small * cube dataset back from disk, and verify that it contains the expected - * data. Verify that H5S_select_shape_same() returns true on the + * data. Verify that H5Sselect_shape_same() returns true on the * memory and file selections. */ @@ -3263,12 +3264,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_small_cube_sid, - mem_large_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(file_small_cube_sid, mem_large_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* write the slice from the in memory large cube to the @@ -3331,7 +3331,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * small cube to slices of the on disk cube. After each write, * read the on disk large cube * into memeory, and verify that * it contains the expected * data. Verify that - * H5S_select_shape_same() returns true on the memory and file + * H5Sselect_shape_same() returns true on the memory and file * selections. */ @@ -3395,12 +3395,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ sel_start ); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(file_large_cube_sid, - mem_small_cube_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(file_large_cube_sid, mem_small_cube_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* write the checker board selection of the in memory @@ -3536,7 +3535,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ** test_select_hyper_checker_board_dr(): Test H5S (dataspace) ** selection code with checkerboard source and target having ** different ranks but the same shape. We have already -** tested H5S_select_shape_same in isolation, so now we try to do +** tested H5Sselect_shape_same in isolation, so now we try to do ** I/O. ** ** This is just an initial smoke check, so we will work @@ -4918,12 +4917,11 @@ test_select_hyper_union(void) HDfree(rbuf); } /* test_select_hyper_union() */ -#ifdef NEW_HYPERSLAB_API /**************************************************************** ** ** test_select_hyper_union_stagger(): Test basic H5S (dataspace) selection code. ** Tests unions of staggered hyperslabs. (Uses H5Scombine_hyperslab -** and H5Sselect_select instead of H5Sselect_hyperslab) +** and H5Smodify_select instead of H5Sselect_hyperslab) ** ****************************************************************/ static void @@ -4940,11 +4938,11 @@ test_select_hyper_union_stagger(void) hsize_t count[2]={3,1}; /* 1st Hyperslab size */ hsize_t count2[2]={3,1}; /* 2nd Hyperslab size */ hsize_t count3[2]={2,1}; /* 3rd Hyperslab size */ - hssize_t offset[2]={0,0}; /* 1st Hyperslab offset */ - hssize_t offset2[2]={2,1}; /* 2nd Hyperslab offset */ - hssize_t offset3[2]={4,2}; /* 3rd Hyperslab offset */ + hsize_t start[2]={0,0}; /* 1st Hyperslab offset */ + hsize_t start2[2]={2,1}; /* 2nd Hyperslab offset */ + hsize_t start3[2]={4,2}; /* 3rd Hyperslab offset */ hsize_t count_out[2]={4,2}; /* Hyperslab size in memory */ - hssize_t offset_out[2]={0,3}; /* Hyperslab offset in memory */ + hsize_t start_out[2]={0,3}; /* Hyperslab offset in memory */ int data[6][5]; /* Data to write */ int data_out[7][7]; /* Data read in */ int input_loc[8][2]={{0,0}, @@ -5015,27 +5013,27 @@ test_select_hyper_union_stagger(void) CHECK(dataspace, FAIL, "H5Dget_space"); /* Select the hyperslabs */ - error = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); + error = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block); CHECK(error, FAIL, "H5Sselect_hyperslab"); - tmp_space = H5Scombine_hyperslab(dataspace, H5S_SELECT_OR, offset2, stride, count2, block); + tmp_space = H5Scombine_hyperslab(dataspace, H5S_SELECT_OR, start2, stride, count2, block); CHECK(tmp_space, FAIL, "H5Scombine_hyperslab"); /* Copy the file dataspace and select hyperslab */ tmp2_space = H5Scopy(dataspace); CHECK(tmp2_space, FAIL, "H5Scopy"); - error=H5Sselect_hyperslab(tmp2_space,H5S_SELECT_SET,offset3,stride,count3,block); + error=H5Sselect_hyperslab(tmp2_space, H5S_SELECT_SET, start3, stride, count3, block); CHECK(error, FAIL, "H5Sselect_hyperslab"); /* Combine the copied dataspace with the temporary dataspace */ - error=H5Sselect_select(tmp_space,H5S_SELECT_OR,tmp2_space); - CHECK(error, FAIL, "H5Sselect_select"); + error=H5Smodify_select(tmp_space,H5S_SELECT_OR,tmp2_space); + CHECK(error, FAIL, "H5Smodify_select"); /* Create Memory Dataspace */ memspace=H5Screate_simple(memrank,dimsm,NULL); CHECK(memspace, FAIL, "H5Screate_simple"); /* Select hyperslab in memory */ - error=H5Sselect_hyperslab(memspace,H5S_SELECT_SET,offset_out,stride,count_out,block); + error=H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start_out, stride, count_out, block); CHECK(error, FAIL, "H5Sselect_hyperslab"); /* Read File Dataset */ @@ -5275,7 +5273,109 @@ test_select_hyper_union_3d(void) HDfree(wbuf); HDfree(rbuf); } /* test_select_hyper_union_3d() */ -#endif /* NEW_HYPERSLAB_API */ + +/**************************************************************** +** +** test_select_hyper_valid_combination(): Tests invalid and valid +** combinations of selections on dataspace for H5Scombine_select +** and H5Smodify_select. +** +****************************************************************/ +static void +test_select_hyper_valid_combination(void) +{ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t non_existent_sid = -1; /* A non-existent space id */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims2D[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t dims3D[] = {SPACE4_DIM1, SPACE4_DIM2, SPACE4_DIM3}; + + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hsize_t start[SPACE4_RANK]; /* Hyperslab start */ + hsize_t stride[SPACE4_RANK]; /* Hyperslab stride */ + hsize_t count[SPACE4_RANK]; /* Hyperslab block count */ + hsize_t block[SPACE4_RANK]; /* Hyperslab block size */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Selection Combination Validity\n")); + assert(SPACE9_DIM2>=POINT1_NPOINTS); + + /* Create dataspace for single point selection */ + single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); + CHECK(single_pt_sid, FAIL, "H5Screate_simple"); + + /* Select sequence of ten points for multiple point selection */ + coord1[0][0] = 2; coord1[0][1] = 2; + ret = H5Sselect_elements(single_pt_sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Create dataspace for single hyperslab selection */ + single_hyper_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); + CHECK(single_hyper_sid, FAIL, "H5Screate_simple"); + + /* Select 10x10 hyperslab for single hyperslab selection */ + start[0]=1; start[1]=1; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=(SPACE9_DIM1-2); block[1]=(SPACE9_DIM2-2); + ret = H5Sselect_hyperslab(single_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for regular hyperslab selection */ + regular_hyper_sid = H5Screate_simple(SPACE4_RANK, dims3D, NULL); + CHECK(regular_hyper_sid, FAIL, "H5Screate_simple"); + + /* Select regular, strided hyperslab selection */ + start[0]=2; start[1]=2; start[2]=2; + stride[0]=2; stride[1]=2; stride[2]=2; + count[0]=5; count[1]=2; count[2]=5; + block[0]=1; block[1]=1; block[2]=1; + ret = H5Sselect_hyperslab(regular_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + + /* Test all the selections created */ + + /* Test the invalid combinations between point and hyperslab */ + tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + + tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + + /* Test the invalid combination between two hyperslab but of different dimension size */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + + /* Test invalid operation inputs to the two functions */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + + /* Test inputs in case of non-existent space ids */ + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + VERIFY(tmp_sid, FAIL, "H5Scombine_select"); + + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + VERIFY(tmp_sid, FAIL, "H5Smodify_select"); + + /* Close dataspaces */ + ret = H5Sclose(single_pt_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(single_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(regular_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_select_hyper_valid_combination() */ + /**************************************************************** ** @@ -8100,294 +8200,294 @@ test_shape_same(void) /* Compare "all" selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(all_sid,all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid ,all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ - tmp_sid=H5Scopy(all_sid); + tmp_sid = H5Scopy(all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(all_sid,tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(all_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(all_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(all_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, single_hyper_all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare "none" selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(none_sid, none_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(none_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(none_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(none_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(none_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(none_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, none_hyper_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, none_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(none_sid, scalar_none_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(none_sid, scalar_none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare single point selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(single_pt_sid, single_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(single_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(single_pt_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(single_pt_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(single_pt_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(single_pt_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check=H5S_select_shape_same_test(single_pt_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(single_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare multiple point selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(mult_pt_sid, mult_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, mult_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(mult_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(mult_pt_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(mult_pt_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(mult_pt_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(mult_pt_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(mult_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(mult_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "normal" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(single_hyper_sid, single_hyper_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(single_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(single_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(single_hyper_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(single_hyper_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(single_hyper_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(single_hyper_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check=H5S_select_shape_same_test(single_hyper_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); #ifdef NOT_YET /* In theory, these two selections are the same shape, but the - * H5S_select_shape_same() routine is just not this sophisticated yet and it + * H5Sselect_shape_same() routine is just not this sophisticated yet and it * would take too much effort to make this work. The worst case is that the * non-optimized chunk mapping routines will be invoked instead of the more * optimized routines, so this only hurts performance, not correctness @@ -8409,8 +8509,8 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8436,70 +8536,70 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "all" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(single_hyper_all_sid, single_hyper_all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(single_hyper_all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(single_hyper_all_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); #ifdef NOT_YET /* In theory, these two selections are the same shape, but the @@ -8524,8 +8624,8 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8551,129 +8651,129 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare single "point" hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(single_hyper_pt_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(single_hyper_pt_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, single_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(single_hyper_pt_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(single_hyper_pt_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare regular, strided hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(regular_hyper_sid, regular_hyper_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, regular_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(regular_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(regular_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Construct point selection which matches regular, strided hyperslab selection */ /* Create dataspace for point selection */ @@ -8691,8 +8791,8 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8717,8 +8817,8 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); @@ -8737,70 +8837,70 @@ test_shape_same(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(regular_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(regular_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare irregular hyperslab selection to all the selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(irreg_hyper_sid, irreg_hyper_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, irreg_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(irreg_hyper_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(irreg_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Construct hyperslab selection which matches irregular hyperslab selection */ /* Create dataspace for hyperslab selection */ @@ -8825,141 +8925,141 @@ test_shape_same(void) } /* end for */ /* Compare against hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(irreg_hyper_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(irreg_hyper_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare scalar "all" dataspace with all selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(scalar_all_sid, scalar_all_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, scalar_all_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(scalar_all_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(scalar_all_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(scalar_all_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(scalar_all_sid, none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(scalar_all_sid, single_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(scalar_all_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, single_hyper_pt_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, single_hyper_pt_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, none_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, none_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against scalar "none" hyperslab selection */ - check = H5S_select_shape_same_test(scalar_all_sid, scalar_none_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_all_sid, scalar_none_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare scalar "none" dataspace with all selections created */ /* Compare against itself */ - check = H5S_select_shape_same_test(scalar_none_sid, scalar_none_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, scalar_none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against copy of itself */ tmp_sid = H5Scopy(scalar_none_sid); CHECK(tmp_sid, FAIL, "H5Scopy"); - check = H5S_select_shape_same_test(scalar_none_sid, tmp_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, tmp_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); ret = H5Sclose(tmp_sid); CHECK(ret, FAIL, "H5Sclose"); /* Compare against "all" selection */ - check = H5S_select_shape_same_test(scalar_none_sid, all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "none" selection */ - check = H5S_select_shape_same_test(scalar_none_sid, none_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, none_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against single point selection */ - check = H5S_select_shape_same_test(scalar_none_sid, single_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against multiple point selection */ - check = H5S_select_shape_same_test(scalar_none_sid, mult_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, mult_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "plain" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, single_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "all" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, single_hyper_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "single point" single hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, single_hyper_pt_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, single_hyper_pt_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against regular, strided hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, regular_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, regular_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against irregular hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, irreg_hyper_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, irreg_hyper_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "no" hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, none_hyper_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, none_hyper_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Compare against scalar "all" hyperslab selection */ - check = H5S_select_shape_same_test(scalar_none_sid, scalar_all_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(scalar_none_sid, scalar_all_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9002,7 +9102,7 @@ test_shape_same(void) ** xz plane, and three parallel to the yz plane. ** ** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when comparing +** H5Sselect_shape_same() should return TRUE when comparing ** the full 2-D space against any hyperslab parallel to the ** yz plane in the 3-D space, and FALSE when comparing the ** full 2-D space against the other two hyperslabs. @@ -9011,7 +9111,7 @@ test_shape_same(void) ** and select a (10 X 10 X 2) hyperslab parallel to the yz ** axis in one of them, and two parallel (10 X 10 X 1) hyper ** slabs parallel to the yz axis in the other. -** H5S_select_shape_same() should return FALSE when comparing +** H5Sselect_shape_same() should return FALSE when comparing ** each to the 2-D selection. ** ****************************************************************/ @@ -9200,42 +9300,42 @@ test_shape_same_dr__smoke_check_1(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S_select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S_select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S_select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_3_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_3_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_4_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_4_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9288,15 +9388,15 @@ test_shape_same_dr__smoke_check_1(void) ** a "checker board" hyperslab as follows: ** ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * +** * * - - * * - - * * +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * ** * * - - * * - - * * -** * * - - * * - - * * ** ** where asterisks indicate selected elements, and dashes ** indicate unselected elements. @@ -9308,7 +9408,7 @@ test_shape_same_dr__smoke_check_1(void) ** to the yz plane. ** ** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when comparing +** H5Sselect_shape_same() should return TRUE when comparing ** the 2-D space checker board selection against a checker ** board hyperslab parallel to the yz plane in the 3-D ** space, and FALSE when comparing the 2-D checkerboard @@ -9318,7 +9418,7 @@ test_shape_same_dr__smoke_check_1(void) ** Also create an additional 3-D dataspaces (10 X 10 X 10), ** and select a checker board parallel with the yz axis, ** save with some squares being on different planes. -** H5S_select_shape_same() should return FALSE when +** H5Sselect_shape_same() should return FALSE when ** comparing this selection to the 2-D selection. ** ****************************************************************/ @@ -9613,39 +9713,39 @@ test_shape_same_dr__smoke_check_2(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S_select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S_select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S_select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_3_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_3_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -9719,7 +9819,7 @@ test_shape_same_dr__smoke_check_2(void) ** cases. ** ** Assuming that z is the fastest changing dimension, -** H5S_select_shape_same() should return TRUE when +** H5Sselect_shape_same() should return TRUE when ** comparing the 2-D irregular hyperslab selection ** against the irregular hyperslab selections parallel ** to the yz plane in the 3-D space, and FALSE when @@ -10136,36 +10236,36 @@ test_shape_same_dr__smoke_check_3(void) /* setup is done -- run the tests: */ /* Compare against "xy" selection */ - check = H5S_select_shape_same_test(small_cube_xy_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xy_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xy_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "xz" selection */ - check = H5S_select_shape_same_test(small_cube_xz_slice_0_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_0_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_1_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_1_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_xz_slice_2_sid, small_square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_xz_slice_2_sid, small_square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Compare against "yz" selection */ - check = H5S_select_shape_same_test(small_cube_yz_slice_0_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_0_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_1_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_1_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(small_cube_yz_slice_2_sid, small_square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(small_cube_yz_slice_2_sid, small_square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10229,7 +10329,7 @@ test_shape_same_dr__smoke_check_3(void) ** And select these entire spaces as well. ** ** Compare the 2-D space against all the other spaces -** with H5S_select_shape_same(). The (1 X 10 X 10) & +** with H5Sselect_shape_same(). The (1 X 10 X 10) & ** (1 X 1 X 10 X 10) should return TRUE. All others ** should return FALSE. ** @@ -10347,39 +10447,39 @@ test_shape_same_dr__smoke_check_4(void) /* setup is done -- run the tests: */ - check = H5S_select_shape_same_test(three_d_space_0_sid, square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_0_sid, square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(three_d_space_1_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_1_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(three_d_space_2_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_2_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(three_d_space_3_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(three_d_space_3_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_0_sid, square_sid); - VERIFY(check, TRUE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_0_sid, square_sid); + VERIFY(check, TRUE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_1_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_1_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_2_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_2_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_3_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_3_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_4_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_4_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_5_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_5_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); - check = H5S_select_shape_same_test(four_d_space_6_sid, square_sid); - VERIFY(check, FALSE, "H5S_select_shape_same_test"); + check = H5Sselect_shape_same(four_d_space_6_sid, square_sid); + VERIFY(check, FALSE, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10426,10 +10526,10 @@ test_shape_same_dr__smoke_check_4(void) ** ** test_shape_same_dr__full_space_vs_slice(): Tests selection ** of a full n-cube dataspace vs an n-dimensional slice of -** of an m-cube (m > n) in a call to H5S_select_shape_same(). +** of an m-cube (m > n) in a call to H5Sselect_shape_same(). ** Note that this test does not require the n-cube and the ** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if +** H5Sselect_shape_same() should always return FALSE if ** they don't). ** ** Per Quincey's suggestion, only test up to 5 dimensional @@ -10541,8 +10641,8 @@ test_shape_same_dr__full_space_vs_slice(int test_num, /* setup is done -- run the test: */ - check = H5S_select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__full_space_vs_slice"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -10561,7 +10661,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ** Run the test_shape_same_dr__full_space_vs_slice() test ** over a variety of ranks and offsets. ** -** At present, we test H5S_select_shape_same() with +** At present, we test H5Sselect_shape_same() with ** fully selected 1, 2, 3, and 4 cubes as one parameter, and ** 1, 2, 3, and 4 dimensional slices through a n-cube of rank ** no more than 5 (and at least the rank of the slice). @@ -10569,7 +10669,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num, ** sufficient. ** ** All the n-cubes will have lengths of the same size, so -** H5S_select_shape_same() should return true iff: +** H5Sselect_shape_same() should return true iff: ** ** 1) the rank for the fully selected n cube equals the ** number of dimensions selected in the slice through the @@ -10707,11 +10807,11 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void) ** test_shape_same_dr__checkerboard(): Tests selection of a ** "checker board" subset of a full n-cube dataspace vs ** a "checker board" n-dimensional slice of an m-cube (m > n). -** in a call to H5S_select_shape_same(). +** in a call to H5Sselect_shape_same(). ** ** Note that this test does not require the n-cube and the ** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if +** H5Sselect_shape_same() should always return FALSE if ** they don't). ** ** Per Quincey's suggestion, only test up to 5 dimensional @@ -11031,8 +11131,8 @@ test_shape_same_dr__checkerboard(int test_num, CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* setup is done -- run the test: */ - check = H5S_select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__checkerboard"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -11048,14 +11148,14 @@ test_shape_same_dr__checkerboard(int test_num, ** ** test_shape_same_dr__run_checkerboard_tests(): ** -** In this set of tests, we test H5S_select_shape_same() +** In this set of tests, we test H5Sselect_shape_same() ** with a "checkerboard" selection of 1, 2, 3, and 4 cubes as ** one parameter, and 1, 2, 3, and 4 dimensional checkerboard ** slices through a n-cube of rank no more than 5 (and at ** least the rank of the slice). ** ** All the n-cubes will have lengths of the same size, so -** H5S_select_shape_same() should return true iff: +** H5Sselect_shape_same() should return true iff: ** ** 1) the rank of the n cube equals the number of dimensions ** selected in the checker board slice through the m-cube @@ -11321,11 +11421,11 @@ test_shape_same_dr__run_checkerboard_tests(void) ** Tests selection of an "irregular" subset of a full ** n-cube dataspace vs an identical "irregular" subset ** of an n-dimensional slice of an m-cube (m > n). -** in a call to H5S_select_shape_same(). +** in a call to H5Sselect_shape_same(). ** ** Note that this test does not require the n-cube and the ** n-dimensional slice to have the same rank (although -** H5S_select_shape_same() should always return FALSE if +** H5Sselect_shape_same() should always return FALSE if ** they don't). ** ****************************************************************/ @@ -11575,8 +11675,8 @@ test_shape_same_dr__irregular(int test_num, /* setup is done -- run the test: */ - check = H5S_select_shape_same_test(n_cube_0_sid, n_cube_1_sid); - VERIFY(check, expected_result, "test_shape_same_dr__checkerboard"); + check = H5Sselect_shape_same(n_cube_0_sid, n_cube_1_sid); + VERIFY(check, expected_result, "H5Sselect_shape_same"); /* Close dataspaces */ @@ -11592,7 +11692,7 @@ test_shape_same_dr__irregular(int test_num, ** ** test_shape_same_dr__run_irregular_tests(): ** -** In this set of tests, we test H5S_select_shape_same() +** In this set of tests, we test H5Sselect_shape_same() ** with an "irregular" subselection of 1, 2, 3, and 4 cubes as ** one parameter, and irregular subselections of 1, 2, 3, ** and 4 dimensional slices through a n-cube of rank no more @@ -11601,7 +11701,7 @@ test_shape_same_dr__irregular(int test_num, ** the n-cube and the slice. ** ** All the irregular selections will be identical (modulo rank) -** so H5S_select_shape_same() should return true iff: +** so H5Sselect_shape_same() should return true iff: ** ** 1) the rank of the n cube equals the number of dimensions ** selected in the irregular slice through the m-cube @@ -11849,7 +11949,7 @@ test_space_rebuild(void) hid_t sid_irreg1,sid_irreg2,sid_irreg3,sid_irreg4,sid_irreg5; /* rebuild status state */ - htri_t rebuild_stat; + H5S_diminfo_valid_t rebuild_stat1,rebuild_stat2; htri_t rebuild_check; herr_t ret; @@ -11919,18 +12019,22 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_reg1,H5S_SELECT_OR,start1,stride1,count1,block1); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_reg1); - HDassert(rebuild_stat!=FAIL); - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_reg1,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } - else { + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S_select_shape_same_test(sid_reg1,sid_reg_ori1); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg1, sid_reg_ori1); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* For irregular hyperslab */ @@ -11951,11 +12055,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_irreg1,H5S_SELECT_OR,start1,stride1,count1,block1); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_irreg1); - HDassert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_irreg1,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -11999,18 +12107,22 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_reg2,H5S_SELECT_OR,start2,stride2,count2,block2); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_reg2); - HDassert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_reg2,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } - else { + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } /* end if */ + if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S_select_shape_same_test(sid_reg2,sid_reg_ori2); - CHECK(rebuild_check, FALSE, "H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg2, sid_reg_ori2); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* 2-D irregular case */ @@ -12036,11 +12148,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_irreg2,H5S_SELECT_OR,start2,stride2,count2,block2); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_irreg2); - HDassert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_irreg2,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12089,19 +12205,22 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_reg3,H5S_SELECT_OR,start3,stride3,count3,block3); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_reg3); - assert(rebuild_stat != FAIL); - - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_reg3,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } - else { + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S_select_shape_same_test(sid_reg3,sid_reg_ori3); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg3, sid_reg_ori3); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } sid_irreg3 = H5Screate_simple(SPACERE3_RANK,dims3,NULL); @@ -12132,11 +12251,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_irreg3,H5S_SELECT_OR,start3,stride3,count3,block3); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_irreg3); - assert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_irreg3,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12193,18 +12316,22 @@ test_space_rebuild(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_reg4); - assert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_reg4,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } - else { + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S_select_shape_same_test(sid_reg4,sid_reg_ori4); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg4, sid_reg_ori4); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } /* Testing irregular selection */ @@ -12246,11 +12373,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_irreg4,H5S_SELECT_OR,start4,stride4,count4,block4); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_irreg4); - assert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_irreg4,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12311,18 +12442,22 @@ test_space_rebuild(void) CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_reg5); - assert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_reg5,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } - else { + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(ret != FAIL) { /* In this case, rebuild_check should be TRUE. */ - rebuild_check = H5S_select_shape_same_test(sid_reg5,sid_reg_ori5); - CHECK(rebuild_check,FALSE,"H5S_hyper_rebuild"); + rebuild_check = H5Sselect_shape_same(sid_reg5, sid_reg_ori5); + CHECK(rebuild_check, FALSE, "H5Sselect_shape_same"); } sid_irreg5 = H5Screate_simple(SPACERE5_RANK,dims5,NULL); @@ -12369,11 +12504,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_irreg5,H5S_SELECT_OR,start5,stride5,count5,block5); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_irreg5); - assert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_irreg5,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12411,10 +12550,16 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_SET,start5,stride5,count5,block5); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_spec); - /* In this case, rebuild_stat should be TRUE. */ - if(!rebuild_stat){ + + ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 and rebuild_stat2 should both be + * H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12434,11 +12579,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_OR,start5,stride5,count5,block5); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = TRUE; - rebuild_stat = H5S__get_rebuild_status_test(sid_spec); - HDassert(rebuild_stat != FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12458,11 +12607,15 @@ test_space_rebuild(void) ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_OR,start5,stride5,count5,block5); CHECK(ret, FAIL, "H5Sselect_hyperslab"); - rebuild_stat = FALSE; - rebuild_stat = H5S__get_rebuild_status_test(sid_spec); - HDassert(rebuild_stat!=FAIL); - /* In this case, rebuild_stat should be FALSE. */ - if(!rebuild_stat){ + ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and + * rebuild_stat2 should be H5S_DIMINFO_VALID_YES. */ + if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret,FAIL,"H5S_hyper_rebuild"); + } + if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) { ret = FAIL; CHECK(ret,FAIL,"H5S_hyper_rebuild"); } @@ -12500,6 +12653,791 @@ test_space_rebuild(void) /**************************************************************** ** +** test_space_update_diminfo(): Tests selection diminfo update +** routine. We will test whether regular selections can be +** quickly updated when the selection is modified. +** +** +****************************************************************/ +static void +test_space_update_diminfo(void) +{ + hid_t space_id; /* Dataspace id */ + H5S_diminfo_valid_t diminfo_valid; /* Diminfo status */ + H5S_diminfo_valid_t rebuild_status; /* Diminfo status after rebuid */ + H5S_sel_type sel_type; /* Selection type */ + herr_t ret; /* Return value */ + + /* dimensions of rank 1 to rank 5 */ + hsize_t dims1[] ={SPACEUD1_DIM0}; + hsize_t dims3[] ={SPACEUD3_DIM0, SPACEUD3_DIM1, SPACEUD3_DIM2}; + + /* The start of the hyperslab */ + hsize_t start1[1], start3[3]; + + /* The stride of the hyperslab */ + hsize_t stride1[1], stride3[3]; + + /* The number of blocks for the hyperslab */ + hsize_t count1[1], count3[3]; + + /* The size of each block for the hyperslab */ + hsize_t block1[1], block3[3]; + + + /* Output message about test being performed */ + MESSAGE(6, ("Testing functionality to update hyperslab dimension info\n")); + + + MESSAGE(7, ("Testing functionality to update 1-D hyperslab dimension info\n")); + + /* + * Test adding regularly spaced distinct blocks + */ + + /* Create 1-D dataspace */ + space_id = H5Screate_simple(1, dims1, NULL); + + /* Create single block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block after first, with OR */ + start1[0] = 6; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block before first, this time with XOR */ + start1[0] = 0; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add two blocks after current block */ + start1[0] = 9; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add two blocks overlapping current block, with OR */ + start1[0] = 9; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add two blocks partially overlapping current block, with OR */ + start1[0] = 12; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add two blocks partially overlapping current block, with XOR */ + start1[0] = 15; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO, after rebuild it should be IMPOSSIBLE */ + ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid, + &rebuild_status); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + if(rebuild_status != H5S_DIMINFO_VALID_IMPOSSIBLE) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_rebuild"); + } /* end if */ + + /* Fill in missing block */ + start1[0] = 15; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO, after rebuild it should be YES */ + ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid, + &rebuild_status); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + if(rebuild_status != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_rebuild"); + } /* end if */ + + /* + * Test adding contiguous blocks + */ + + /* Create single block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block immediately after first, with OR */ + start1[0] = 5; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block immediately before first, with XOR */ + start1[0] = 1; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add differently size block immediately after current, with OR */ + start1[0] = 7; + count1[0] = 1; + block1[0] = 7; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* + * Test adding overlapping blocks + */ + + /* Create single block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block completely overlapping first, with OR */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block parially overlapping first, with OR */ + start1[0] = 4; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block completely enclosing current, with OR */ + start1[0] = 2; + count1[0] = 1; + block1[0] = 5; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add block completely enclosed by current, with OR */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add equally sized block parially overlapping current, with XOR */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 5; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Fill in hole in block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 4; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO, after rebuild it should be YES */ + ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid, + &rebuild_status); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + if(rebuild_status != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_rebuild"); + } /* end if */ + + /* Add differently sized block parially overlapping current, with XOR */ + start1[0] = 4; + count1[0] = 1; + block1[0] = 5; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Fill in hole in block */ + start1[0] = 4; + count1[0] = 1; + block1[0] = 4; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO, after rebuild it should be YES */ + ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid, + &rebuild_status); + CHECK(ret, FAIL, "H5S__get_rebuild_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + if(rebuild_status != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_rebuild"); + } /* end if */ + + /* Add block completely overlapping current, with XOR */ + start1[0] = 2; + count1[0] = 1; + block1[0] = 7; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + sel_type = H5Sget_select_type(space_id); + VERIFY(sel_type, H5S_SEL_NONE, "H5Sget_select_type"); + + /* + * Test various conditions that break the fast algorithm + */ + + /* Create multiple blocks */ + start1[0] = 3; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create single block with start out of phase */ + start1[0] = 8; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start1[0] = 3; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks with start out of phase */ + start1[0] = 8; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start1[0] = 3; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks with wrong stride */ + start1[0] = 9; + stride1[0] = 4; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create single block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create single block with wrong size */ + start1[0] = 6; + count1[0] = 1; + block1[0] = 1; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create single block */ + start1[0] = 3; + count1[0] = 1; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks with wrong size */ + start1[0] = 6; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 1; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start1[0] = 3; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create single block with wrong size */ + start1[0] = 9; + count1[0] = 1; + block1[0] = 1; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start1[0] = 3; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks with wrong size */ + start1[0] = 9; + stride1[0] = 3; + count1[0] = 2; + block1[0] = 1; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + ret = H5Sclose(space_id); + CHECK(ret, FAIL, "H5Sclose"); + + + MESSAGE(7, ("Testing functionality to update 3-D hyperslab dimension info\n")); + + /* Create 3-D dataspace */ + space_id = H5Screate_simple(3, dims3, NULL); + + /* Create multiple blocks */ + start3[0] = 0; + start3[1] = 1; + start3[2] = 2; + stride3[0] = 2; + stride3[1] = 3; + stride3[2] = 4; + count3[0] = 4; + count3[1] = 3; + count3[2] = 2; + block3[0] = 1; + block3[1] = 2; + block3[2] = 3; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add blocks with same values in all dimensions */ + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add blocks with same values in two dimensions */ + start3[0] = 8; + stride3[0] = 1; + count3[0] = 1; + block3[0] = 1; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start3[0] = 0; + start3[1] = 1; + start3[2] = 2; + stride3[0] = 2; + stride3[1] = 3; + stride3[2] = 4; + count3[0] = 4; + count3[1] = 3; + count3[2] = 2; + block3[0] = 1; + block3[1] = 2; + block3[2] = 3; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add blocks with same values in one dimension */ + start3[0] = 8; + start3[1] = 10; + stride3[0] = 1; + stride3[1] = 1; + count3[0] = 1; + count3[1] = 1; + block3[0] = 1; + block3[1] = 2; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Create multiple blocks */ + start3[0] = 0; + start3[1] = 1; + start3[2] = 2; + stride3[0] = 2; + stride3[1] = 3; + stride3[2] = 4; + count3[0] = 4; + count3[1] = 3; + count3[2] = 2; + block3[0] = 1; + block3[1] = 2; + block3[2] = 3; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be YES */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_YES) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + /* Add blocks with same values in no dimensions */ + start3[0] = 8; + start3[1] = 10; + start3[2] = 10; + stride3[0] = 1; + stride3[1] = 1; + stride3[2] = 1; + count3[0] = 1; + count3[1] = 1; + count3[2] = 1; + block3[0] = 1; + block3[1] = 2; + block3[2] = 3; + ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* diminfo_valid should be NO */ + ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid); + CHECK(ret, FAIL, "H5S__get_diminfo_status_test"); + if(diminfo_valid != H5S_DIMINFO_VALID_NO) { + ret = FAIL; + CHECK(ret, FAIL, "H5S_hyper_update_diminfo"); + } /* end if */ + + ret = H5Sclose(space_id); + CHECK(ret, FAIL, "H5Sclose"); +} /* end test_space_update_diminfo() */ + + +/**************************************************************** +** ** test_select_hyper_chunk_offset(): Tests selections on dataspace, ** verify that offsets for hyperslab selections are working in ** chunked datasets. @@ -13610,6 +14548,659 @@ test_hyper_unlim(void) /**************************************************************** ** +** test_internal_consistency(): Tests selections on dataspace, then +** verify that internal states of data structures of selections are +** consistent. +** +****************************************************************/ +static void +test_internal_consistency(void) +{ + hid_t all_sid; /* Dataspace ID with "all" selection */ + hid_t none_sid; /* Dataspace ID with "none" selection */ + hid_t single_pt_sid; /* Dataspace ID with single point selection */ + hid_t mult_pt_sid; /* Dataspace ID with multiple point selection */ + hid_t single_hyper_sid; /* Dataspace ID with single block hyperslab selection */ + hid_t single_hyper_all_sid; /* Dataspace ID with single block hyperslab + * selection that is the entire dataspace + */ + hid_t single_hyper_pt_sid; /* Dataspace ID with single block hyperslab + * selection that is the same as the single + * point selection + */ + hid_t regular_hyper_sid; /* Dataspace ID with regular hyperslab selection */ + hid_t irreg_hyper_sid; /* Dataspace ID with irregular hyperslab selection */ + hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */ + hid_t scalar_all_sid; /* ID for scalar dataspace with "all" selection */ + hid_t scalar_none_sid; /* ID for scalar dataspace with "none" selection */ + hid_t tmp_sid; /* Temporary dataspace ID */ + hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2}; + hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */ + hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */ + hsize_t start[SPACE9_RANK]; /* Hyperslab start */ + hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */ + hsize_t count[SPACE9_RANK]; /* Hyperslab block count */ + hsize_t block[SPACE9_RANK]; /* Hyperslab block size */ + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Consistency of Internal States\n")); + assert(SPACE9_DIM2>=POINT1_NPOINTS); + + /* Create dataspace for "all" selection */ + all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(all_sid, FAIL, "H5Screate_simple"); + + /* Select entire extent for dataspace */ + ret = H5Sselect_all(all_sid); + CHECK(ret, FAIL, "H5Sselect_all"); + + /* Create dataspace for "none" selection */ + none_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(none_sid, FAIL, "H5Screate_simple"); + + /* Un-Select entire extent for dataspace */ + ret = H5Sselect_none(none_sid); + CHECK(ret, FAIL, "H5Sselect_none"); + + /* Create dataspace for single point selection */ + single_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(single_pt_sid, FAIL, "H5Screate_simple"); + + /* Select sequence of ten points for multiple point selection */ + coord1[0][0] = 2; coord1[0][1] = 2; + ret = H5Sselect_elements(single_pt_sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Create dataspace for multiple point selection */ + mult_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(mult_pt_sid, FAIL, "H5Screate_simple"); + + /* Select sequence of ten points for multiple point selection */ + coord2[0][0]=2; coord2[0][1]=2; + coord2[1][0]=7; coord2[1][1]=2; + coord2[2][0]=1; coord2[2][1]=4; + coord2[3][0]=2; coord2[3][1]=6; + coord2[4][0]=0; coord2[4][1]=8; + coord2[5][0]=3; coord2[5][1]=2; + coord2[6][0]=4; coord2[6][1]=4; + coord2[7][0]=1; coord2[7][1]=0; + coord2[8][0]=5; coord2[8][1]=1; + coord2[9][0]=9; coord2[9][1]=3; + ret = H5Sselect_elements(mult_pt_sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord2); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Create dataspace for single hyperslab selection */ + single_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(single_hyper_sid, FAIL, "H5Screate_simple"); + + /* Select 10x10 hyperslab for single hyperslab selection */ + start[0]=1; start[1]=1; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=(SPACE9_DIM1-2); block[1]=(SPACE9_DIM2-2); + ret = H5Sselect_hyperslab(single_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for single hyperslab selection with entire extent selected */ + single_hyper_all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(single_hyper_all_sid, FAIL, "H5Screate_simple"); + + /* Select entire extent for hyperslab selection */ + start[0]=0; start[1]=0; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=SPACE9_DIM1; block[1]=SPACE9_DIM2; + ret = H5Sselect_hyperslab(single_hyper_all_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for single hyperslab selection with single point selected */ + single_hyper_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(single_hyper_pt_sid, FAIL, "H5Screate_simple"); + + /* Select entire extent for hyperslab selection */ + start[0]=2; start[1]=2; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=1; block[1]=1; + ret = H5Sselect_hyperslab(single_hyper_pt_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for regular hyperslab selection */ + regular_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(regular_hyper_sid, FAIL, "H5Screate_simple"); + + /* Select regular, strided hyperslab selection */ + start[0]=2; start[1]=2; + stride[0]=2; stride[1]=2; + count[0]=5; count[1]=2; + block[0]=1; block[1]=1; + ret = H5Sselect_hyperslab(regular_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for irregular hyperslab selection */ + irreg_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(irreg_hyper_sid, FAIL, "H5Screate_simple"); + + /* Create irregular hyperslab selection by OR'ing two blocks together */ + start[0]=2; start[1]=2; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=1; block[1]=1; + ret = H5Sselect_hyperslab(irreg_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + start[0]=4; start[1]=4; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=3; block[1]=3; + ret = H5Sselect_hyperslab(irreg_hyper_sid,H5S_SELECT_OR,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create dataspace for "no" hyperslab selection */ + none_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); + CHECK(none_hyper_sid, FAIL, "H5Screate_simple"); + + /* Create "no" hyperslab selection by XOR'ing same blocks together */ + start[0]=2; start[1]=2; + stride[0]=1; stride[1]=1; + count[0]=1; count[1]=1; + block[0]=1; block[1]=1; + ret = H5Sselect_hyperslab(none_hyper_sid,H5S_SELECT_SET,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + ret = H5Sselect_hyperslab(none_hyper_sid,H5S_SELECT_XOR,start,stride,count,block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Create scalar dataspace for "all" selection */ + scalar_all_sid = H5Screate(H5S_SCALAR); + CHECK(scalar_all_sid, FAIL, "H5Screate"); + + /* Create scalar dataspace for "none" selection */ + scalar_none_sid = H5Screate(H5S_SCALAR); + CHECK(scalar_none_sid, FAIL, "H5Screate"); + + /* Un-Select entire extent for dataspace */ + ret = H5Sselect_none(scalar_none_sid); + CHECK(ret, FAIL, "H5Sselect_none"); + + /* Test all the selections created */ + + /* Test the copy of itself */ + tmp_sid=H5Scopy(all_sid); + CHECK(tmp_sid, FAIL, "H5Scopy"); + + check = H5S__internal_consistency_test(tmp_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + ret = H5Sclose(tmp_sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Test "none" selection */ + check = H5S__internal_consistency_test(none_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test single point selection */ + check = H5S__internal_consistency_test(single_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test multiple point selection */ + check = H5S__internal_consistency_test(mult_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test "plain" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test "all" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_all_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test "single point" single hyperslab selection */ + check = H5S__internal_consistency_test(single_hyper_pt_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test regular, strided hyperslab selection */ + check = H5S__internal_consistency_test(regular_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test irregular hyperslab selection */ + check = H5S__internal_consistency_test(irreg_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test "no" hyperslab selection */ + check = H5S__internal_consistency_test(none_hyper_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test scalar "all" hyperslab selection */ + check = H5S__internal_consistency_test(scalar_all_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Test scalar "none" hyperslab selection */ + check = H5S__internal_consistency_test(scalar_none_sid); + VERIFY(check, TRUE, "H5S__internal_consistency_test"); + + /* Close dataspaces */ + ret = H5Sclose(all_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(none_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(single_pt_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(mult_pt_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(single_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(single_hyper_all_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(single_hyper_pt_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(regular_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(irreg_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(none_hyper_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(scalar_all_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(scalar_none_sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_internal_consistency() */ + +/**************************************************************** +** +** test_irreg_io(): Tests unusual selections on datasets, to stress the +** new hyperslab code. +** +****************************************************************/ +static void +test_irreg_io(void) +{ + hid_t fid; /* File ID */ + hid_t did; /* Dataset ID */ + hid_t dcpl_id; /* Dataset creation property list ID */ + hid_t sid; /* File dataspace ID */ + hid_t mem_sid; /* Memory dataspace ID */ + hsize_t dims[] = {6, 12}; /* Dataspace dimensions */ + hsize_t chunk_dims[] = {2, 2}; /* Chunk dimensions */ + hsize_t mem_dims[] = {32}; /* Memory dataspace dimensions */ + hsize_t start[2]; /* Hyperslab start */ + hsize_t stride[2]; /* Hyperslab stride */ + hsize_t count[2]; /* Hyperslab block count */ + hsize_t block[2]; /* Hyperslab block size */ + unsigned char wbuf[72]; /* Write buffer */ + unsigned char rbuf[32]; /* Read buffer */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Irregular Hyperslab I/O\n")); + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create dataspace for dataset */ + sid = H5Screate_simple(2, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Set chunk dimensions for dataset */ + dcpl_id = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl_id, FAIL, "H5Pcreate"); + ret = H5Pset_chunk(dcpl_id, 2, chunk_dims); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Create a dataset */ + did = H5Dcreate2(fid, SPACE1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate2"); + + /* Initialize the write buffer */ + for(u = 0; u < 72; u++) + wbuf[u] = (unsigned char)u; + + /* Write entire dataset to disk */ + ret = H5Dwrite(did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close the DCPL */ + ret = H5Pclose(dcpl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Create dataspace for memory selection */ + mem_sid = H5Screate_simple(1, mem_dims, NULL); + CHECK(mem_sid, FAIL, "H5Screate_simple"); + + /* Select 'L'-shaped region within dataset */ + start[0] = 0; start[1] = 10; + stride[0] = 1; stride[1] = 1; + count[0] = 4; count[1] = 2; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + start[0] = 4; start[1] = 0; + stride[0] = 1; stride[1] = 1; + count[0] = 2; count[1] = 12; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Reset the buffer */ + HDmemset(rbuf, 0, sizeof(rbuf)); + + /* Read selection from disk */ + ret = H5Dread(did, H5T_NATIVE_UCHAR, mem_sid, sid, H5P_DEFAULT, rbuf); + CHECK(ret, FAIL, "H5Dread"); + + + /* Close everything */ + ret = H5Sclose(mem_sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_irreg_io() */ + +/**************************************************************** +** +** test_select_intersect_block(): Test selections on dataspace, +** verify that "intersect block" routine is working correctly. +** +****************************************************************/ +static void +test_select_intersect_block(void) +{ + hid_t sid; /* Dataspace ID */ + hsize_t dims1[] = {6, 12}; /* 2-D Dataspace dimensions */ + hsize_t block_start[] = {1, 3}; /* Start offset for block */ + hsize_t block_end[] = {2, 5}; /* End offset for block */ + hsize_t block_end2[] = {0, 5}; /* Bad end offset for block */ + hsize_t block_end3[] = {2, 2}; /* Another bad end offset for block */ + hsize_t block_end4[] = {1, 3}; /* End offset that makes a single element block */ + hsize_t coord[10][2]; /* Coordinates for point selection */ + hsize_t start[2]; /* Starting location of hyperslab */ + hsize_t stride[2]; /* Stride of hyperslab */ + hsize_t count[2]; /* Element count of hyperslab */ + hsize_t block[2]; /* Block size of hyperslab */ + htri_t status; /* Intersection status */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Dataspace Selection Block Intersection\n")); + + /* Create dataspace */ + sid = H5Screate_simple(2, dims1, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + + /* Try intersection calls with bad parameters */ + H5E_BEGIN_TRY { /* Bad dataspace ID */ + status = H5Sselect_intersect_block(H5I_INVALID_HID, block_start, block_end); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Bad start pointer */ + status = H5Sselect_intersect_block(sid, NULL, block_end); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Bad end pointer */ + status = H5Sselect_intersect_block(sid, block_start, NULL); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Invalid block */ + status = H5Sselect_intersect_block(sid, block_start, block_end2); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + H5E_BEGIN_TRY { /* Another invalid block */ + status = H5Sselect_intersect_block(sid, block_start, block_end3); + } H5E_END_TRY; + VERIFY(status, FAIL, "H5Sselect_intersect_block"); + + + /* Set selection to 'none' */ + ret = H5Sselect_none(sid); + CHECK(ret, FAIL, "H5Sselect_none"); + + /* Test block intersection with 'none' selection (always false) */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Set selection to 'all' */ + ret = H5Sselect_all(sid); + CHECK(ret, FAIL, "H5Sselect_all"); + + /* Test block intersection with 'all' selection (always true) */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + + + /* Select sequence of ten points */ + coord[0][0] = 0; coord[0][1] = 10; + coord[1][0] = 1; coord[1][1] = 2; + coord[2][0] = 2; coord[2][1] = 4; + coord[3][0] = 0; coord[3][1] = 6; + coord[4][0] = 1; coord[4][1] = 8; + coord[5][0] = 2; coord[5][1] = 11; + coord[6][0] = 0; coord[6][1] = 4; + coord[7][0] = 1; coord[7][1] = 0; + coord[8][0] = 2; coord[8][1] = 1; + coord[9][0] = 0; coord[9][1] = 3; + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)10, (const hsize_t *)coord); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Test block intersection with 'point' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Select single 4x6 hyperslab block at (2,1) */ + start[0] = 2; start[1] = 1; + stride[0] = 1; stride[1] = 1; + count[0] = 4; count[1] = 6; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with single 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + /* 'OR' another hyperslab block in, making an irregular hyperslab selection */ + start[0] = 3; start[1] = 2; + stride[0] = 1; stride[1] = 1; + count[0] = 4; count[1] = 6; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + /* Select regular, strided hyperslab selection */ + start[0] = 2; start[1] = 1; + stride[0] = 2; stride[1] = 2; + count[0] = 2; count[1] = 4; + block[0] = 1; block[1] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Test block intersection with single 'hyperslab' selection */ + status = H5Sselect_intersect_block(sid, block_start, block_end); + VERIFY(status, TRUE, "H5Sselect_intersect_block"); + status = H5Sselect_intersect_block(sid, block_start, block_end4); + VERIFY(status, FALSE, "H5Sselect_intersect_block"); + + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_select_intersect_block() */ + + +/**************************************************************** +** +** test_hyper_io_1d(): +** Test to verify all the selected 10th element in the 1-d file +** dataspace is read correctly into the 1-d contiguous memory space. +** This is modeled after the test scenario described in HDFFV-10585 +** that demonstrated the hyperslab slowness. A fix to speed up +** performance is in place to handle the special case for 1-d disjoint +** file dataspace into 1-d single block contiguous memory space. +** +****************************************************************/ +static void +test_hyper_io_1d(void) +{ + hid_t fid; /* File ID */ + hid_t did; /* Dataset ID */ + hid_t sid, mid; /* Dataspace IDs */ + hid_t dcpl; /* Dataset creation property list ID */ + hsize_t dims[1], maxdims[1], dimsm[1]; /* Dataset dimension sizes */ + hsize_t chunk_dims[1]; /* Chunk dimension size */ + hsize_t offset[1]; /* Starting offset for hyperslab */ + hsize_t stride[1]; /* Distance between blocks in the hyperslab selection */ + hsize_t count[1]; /* # of blocks in the the hyperslab selection */ + hsize_t block[1]; /* Size of block in the hyperslab selection */ + unsigned int wdata[CHUNKSZ]; /* Data to be written */ + unsigned int rdata[NUM_ELEMENTS/10]; /* Data to be read */ + herr_t ret; /* Generic return value */ + unsigned i; /* Local index variable */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing Hyperslab I/O for 1-d single block memory space\n")); + + for (i = 0; i < CHUNKSZ; i++) + wdata[i] = i; + + /* Create the file file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, H5I_INVALID_HID, "H5Fcreate"); + + /* Create file dataspace */ + dims[0] = CHUNKSZ; + maxdims[0] = H5S_UNLIMITED; + sid = H5Screate_simple(RANK, dims, maxdims); + CHECK(sid, H5I_INVALID_HID, "H5Pcreate"); + + /* Create memory dataspace */ + dimsm[0] = CHUNKSZ; + mid = H5Screate_simple(RANK, dimsm, NULL); + CHECK(mid, H5I_INVALID_HID, "H5Pcreate"); + + /* Set up to create a chunked dataset */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate"); + + chunk_dims[0] = CHUNKSZ; + ret = H5Pset_chunk(dcpl, RANK, chunk_dims); + CHECK(ret, FAIL, "H5Pset_chunk"); + + /* Create a chunked dataset */ + did = H5Dcreate2(fid, DNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + CHECK(did, H5I_INVALID_HID, "H5Dcreate2"); + + /* Set up hyperslab selection for file dataspace */ + offset[0] = 0; + stride[0] = 1; + count[0] = 1; + block[0] = CHUNKSZ; + + /* Write to each chunk in the dataset */ + for (i = 0; i < NUMCHUNKS; i++) { + /* Set the hyperslab selection */ + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Write to the dataset */ + ret = H5Dwrite(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, wdata); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Extend the dataset's dataspace */ + if(i < (NUMCHUNKS - 1)) { + offset[0] = offset[0] + CHUNKSZ; + dims[0] = dims[0] + CHUNKSZ; + ret = H5Dset_extent(did, dims); + CHECK(ret, FAIL, "H5Dset_extent"); + + /* Get the dataset's current dataspace */ + sid = H5Dget_space(did); + CHECK(sid, H5I_INVALID_HID, "H5Dget_space"); + } + } + + /* Closing */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(mid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Pclose(dcpl); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + /* Open the file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, H5I_INVALID_HID, "H5Fopen"); + + /* Open the dataset */ + did = H5Dopen2(fid, DNAME, H5P_DEFAULT); + CHECK(did, H5I_INVALID_HID, "H5Dopen"); + + /* Set up to read every 10th element in file dataspace */ + offset[0] = 1; + stride[0] = 10; + count[0] = NUM_ELEMENTS/10; + block[0] = 1; + + /* Get the dataset's dataspace */ + sid = H5Dget_space(did); + CHECK(sid, H5I_INVALID_HID, "H5Pcreate"); + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Set up contiguous memory dataspace for the selected elements */ + dimsm[0] = count[0]; + mid = H5Screate_simple(RANK, dimsm, NULL); + CHECK(mid, H5I_INVALID_HID, "H5Screate"); + + /* Read all the selected 10th elements in the dataset into "rdata" */ + ret = H5Dread(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, rdata); + CHECK(ret, FAIL, "H5Dread"); + + /* Verify data read is correct */ + for(i = 0; i < 6; i += 2) { + VERIFY(rdata[i], 1, "H5Dread\n"); + VERIFY(rdata[i+1], 11, "H5Dread\n"); + } + + /* Closing */ + ret = H5Sclose(mid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + +} /* test_hyper_io_1d() */ + + +/**************************************************************** +** ** test_select(): Main H5S selection testing routine. ** ****************************************************************/ @@ -13676,10 +15267,12 @@ test_select(void) test_select_hyper_offset2();/* Test more selection offset code with hyperslabs */ test_select_point_offset(); /* Test selection offset code with elements */ test_select_hyper_union(); /* Test hyperslab union code */ -#ifdef NEW_HYPERSLAB_API + + /* Fancy hyperslab API tests */ test_select_hyper_union_stagger(); /* Test hyperslab union code for staggered slabs */ test_select_hyper_union_3d(); /* Test hyperslab union code for 3-D dataset */ -#endif /* NEW_HYPERSLAB_API */ + test_select_hyper_valid_combination(); /* Test different input combinations */ + test_select_hyper_and_2d(); /* Test hyperslab intersection (AND) code for 2-D dataset */ test_select_hyper_xor_2d(); /* Test hyperslab XOR code for 2-D dataset */ test_select_hyper_notb_2d(); /* Test hyperslab NOTB code for 2-D dataset */ @@ -13755,6 +15348,8 @@ test_select(void) /* Test "re-build" routine */ test_space_rebuild(); + /* Test "update diminfo" routine */ + test_space_update_diminfo(); /* Test point selections in chunked datasets */ test_select_point_chunk(); @@ -13775,6 +15370,18 @@ test_select(void) /* Test unlimited hyperslab selections */ test_hyper_unlim(); + /* Test the consistency of internal data structures of selection */ + test_internal_consistency(); + + /* Test irregular selection I/O */ + test_irreg_io(); + + /* Test selection intersection with block */ + test_select_intersect_block(); + + /* Test reading of 1-d disjoint file space to 1-d single block memory space */ + test_hyper_io_1d(); + } /* test_select() */ |