summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ntypes.c2
-rw-r--r--test/trefer.c2
-rw-r--r--test/tselect.c32
3 files changed, 28 insertions, 8 deletions
diff --git a/test/ntypes.c b/test/ntypes.c
index 9ddcefc..53276a2 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -1624,7 +1624,7 @@ test_refer_dtype2(hid_t file)
/* Create references */
/* Select 6x6 hyperslab for first reference */
start[0]=2; start[1]=2;
- stride[0]=0; stride[1]=0;
+ stride[0]=1; stride[1]=1;
count[0]=1; count[1]=1;
block[0]=6; block[1]=6;
diff --git a/test/trefer.c b/test/trefer.c
index bb67a61..7a94d62 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -385,7 +385,7 @@ test_reference_region(void)
/* Select 6x6 hyperslab for first reference */
start[0]=2; start[1]=2;
- stride[0]=0; stride[1]=0;
+ stride[0]=1; stride[1]=1;
count[0]=1; count[1]=1;
block[0]=6; block[1]=6;
ret = H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block);
diff --git a/test/tselect.c b/test/tselect.c
index e3b72ec..c08a611 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -205,6 +205,26 @@ test_select_hyper(hid_t xfer_plist)
ext_type = H5Sget_simple_extent_type(sid1);
VERIFY(ext_type, H5S_SIMPLE, "H5Sget_simple_extent_type");
+ /* Test selecting stride==0 to verify failure */
+ start[0]=1; start[1]=0; start[2]=0;
+ stride[0]=0; stride[1]=0; stride[2]=0;
+ count[0]=2; count[1]=15; count[2]=13;
+ block[0]=1; block[1]=1; block[2]=1;
+ H5E_BEGIN_TRY {
+ ret = H5Sselect_hyperslab(sid1,H5S_SELECT_SET,start,stride,count,block);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Test selecting stride<block to verify failure */
+ start[0]=1; start[1]=0; start[2]=0;
+ stride[0]=1; stride[1]=1; stride[2]=1;
+ count[0]=2; count[1]=15; count[2]=13;
+ block[0]=2; block[1]=2; block[2]=2;
+ H5E_BEGIN_TRY {
+ ret = H5Sselect_hyperslab(sid1,H5S_SELECT_SET,start,stride,count,block);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sselect_hyperslab");
+
/* Select 2x15x13 hyperslab for disk dataset */
start[0]=1; start[1]=0; start[2]=0;
stride[0]=1; stride[1]=1; stride[2]=1;
@@ -4140,7 +4160,7 @@ test_select_combine(void)
/* 'AND' "all" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_AND,start,stride,count,block);
@@ -4274,7 +4294,7 @@ test_select_combine(void)
/* 'OR' "none" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_OR,start,stride,count,block);
@@ -4309,7 +4329,7 @@ test_select_combine(void)
/* 'AND' "none" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_AND,start,stride,count,block);
@@ -4329,7 +4349,7 @@ test_select_combine(void)
/* 'XOR' "none" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_XOR,start,stride,count,block);
@@ -4364,7 +4384,7 @@ test_select_combine(void)
/* 'NOTB' "none" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_NOTB,start,stride,count,block);
@@ -4384,7 +4404,7 @@ test_select_combine(void)
/* 'NOTA' "none" selection with another hyperslab */
start[0]=start[1]=0;
- stride[0]=stride[1]=0;
+ stride[0]=stride[1]=1;
count[0]=count[1]=1;
block[0]=block[1]=5;
error=H5Sselect_hyperslab(space1,H5S_SELECT_NOTA,start,stride,count,block);