summaryrefslogtreecommitdiffstats
path: root/test/tselect.c
diff options
context:
space:
mode:
authorChristian Chilan <chilan@hdfgroup.org>2007-01-17 20:49:34 (GMT)
committerChristian Chilan <chilan@hdfgroup.org>2007-01-17 20:49:34 (GMT)
commit9fbb0d98d9bb88f118d94b1ff15aa12178d51b99 (patch)
tree3fcfd9d8fff09e30c07c091639acdb61f8332de5 /test/tselect.c
parent73dafaf54c767714983ef778bd4d25f6a21eb3a1 (diff)
downloadhdf5-9fbb0d98d9bb88f118d94b1ff15aa12178d51b99.zip
hdf5-9fbb0d98d9bb88f118d94b1ff15aa12178d51b99.tar.gz
hdf5-9fbb0d98d9bb88f118d94b1ff15aa12178d51b99.tar.bz2
[svn-r13149] Added tests to verify that H5Sselect_valid() returns FAIL when dataspace is not valid, or when dataspace is valid but closed.
Diffstat (limited to 'test/tselect.c')
-rw-r--r--test/tselect.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/test/tselect.c b/test/tselect.c
index 43299cc..166a29b 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -4431,13 +4431,33 @@ test_select_valid(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Selection Validity\n"));
+ MESSAGE(8, ( "Case 1 : sub_space is not a valid dataspace\n"));
+ dims[0] = dims[1] = H5S_UNLIMITED;
+
+ sub_space = H5Screate_simple(2,dims,NULL);
+ VERIFY(sub_space, FAIL, "H5Screate_simple");
+
+ valid=H5Sselect_valid(sub_space);
+ VERIFY(valid, FAIL, "H5Sselect_valid");
+
+ /* Set arrays and dataspace for the rest of the cases */
count[0] = count[1] = 1;
dims[0] = dims[1] = maxdims[0] = maxdims[1] = 10;
main_space = H5Screate_simple(2,dims,maxdims);
CHECK(main_space, FAIL, "H5Screate_simple");
- MESSAGE(8, ( "Case 1 : in the dimensions\nTry offset (4,4) and size(6,6), the original space is of size (10,10)\n"));
+ MESSAGE(8, ( "Case 2 : sub_space is a valid but closed dataspace\n"));
+ sub_space = H5Scopy(main_space);
+ CHECK(sub_space, FAIL, "H5Scopy");
+
+ error=H5Sclose(sub_space);
+ CHECK(error, FAIL, "H5Sclose");
+
+ valid=H5Sselect_valid(sub_space);
+ VERIFY(valid, FAIL, "H5Sselect_valid");
+
+ MESSAGE(8, ( "Case 3 : in the dimensions\nTry offset (4,4) and size(6,6), the original space is of size (10,10)\n"));
start[0] = start[1] = 4;
size[0] = size[1] = 6;
@@ -4459,7 +4479,7 @@ test_select_valid(void)
error=H5Sclose(sub_space);
CHECK(error, FAIL, "H5Sclose");
- MESSAGE(8, ( "Case 2 : exceed dimensions by 1\nTry offset (5,5) and size(6,6), the original space is of size (10,10)\n"));
+ MESSAGE(8, ( "Case 4 : exceed dimensions by 1\nTry offset (5,5) and size(6,6), the original space is of size (10,10)\n"));
start[0] = start[1] = 5;
size[0] = size[1] = 6;
@@ -4481,7 +4501,7 @@ test_select_valid(void)
error=H5Sclose(sub_space);
CHECK(error, FAIL, "H5Sclose");
- MESSAGE(8, ( "Case 3 : exceed dimensions by 2\nTry offset (6,6) and size(6,6), the original space is of size (10,10)\n"));
+ MESSAGE(8, ( "Case 5 : exceed dimensions by 2\nTry offset (6,6) and size(6,6), the original space is of size (10,10)\n"));
start[0] = start[1] = 6;
size[0] = size[1] = 6;