summaryrefslogtreecommitdiffstats
path: root/java/test
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-27 21:48:02 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-27 21:48:02 (GMT)
commitf8b3f576cebf168fea70c2a39fbe404ac1c7e4e7 (patch)
treeace6c8a48a32100eac47ca693aa4743da7ba2a69 /java/test
parent313a8c8546b3b975fba722b015c8c8269dd240cb (diff)
downloadhdf5-f8b3f576cebf168fea70c2a39fbe404ac1c7e4e7.zip
hdf5-f8b3f576cebf168fea70c2a39fbe404ac1c7e4e7.tar.gz
hdf5-f8b3f576cebf168fea70c2a39fbe404ac1c7e4e7.tar.bz2
HDFFV-10868 - add H5Sselect API java wrappers.
Also added javadoc comments to H5E and H5s constants.
Diffstat (limited to 'java/test')
-rw-r--r--java/test/TestH5Sbasic.java138
-rw-r--r--java/test/testfiles/JUnit-TestH5Sbasic.txt16
2 files changed, 153 insertions, 1 deletions
diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java
index 2173647..9874584 100644
--- a/java/test/TestH5Sbasic.java
+++ b/java/test/TestH5Sbasic.java
@@ -242,4 +242,142 @@ public class TestH5Sbasic {
H5.H5Sdecode(null);
}
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sget_regular_hyperslab_invalid() throws Throwable {
+ long q_start[] = new long[2];
+ long q_stride[] = new long[2];
+ long q_count[] = new long[2];
+ long q_block[] = new long[2];
+
+ H5.H5Sget_regular_hyperslab(-1, q_start, q_stride, q_count, q_block);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Sselect_copy_invalid() throws Throwable {
+ H5.H5Sselect_copy(-1, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class)
+ public void testH5Sselect_shape_same_invalid() throws Throwable {
+ H5.H5Sselect_shape_same(-1, -1);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_adjust_invalid() throws Throwable {
+ long offset[][] = {{0,1},{2,4},{5,6}};
+ H5.H5Sselect_adjust(-1, offset);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_adjust_rank_offset() throws Throwable {
+ long sid = -1;
+ long offset[][] = {{0,1},{2,4},{5,6}};
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_adjust(sid, offset);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_invalid() throws Throwable {
+ long start[] = new long[2];
+ long end[] = new long[2];
+ H5.H5Sselect_intersect_block(-1, start, end);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_rank_start() throws Throwable {
+ long sid = -1;
+ long start[] = new long[2];
+ long end[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_intersect_block(sid, start, end);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_rank_end() throws Throwable {
+ long sid = -1;
+ long start[] = null;
+ long end[] = new long[2];
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_intersect_block(sid, start, end);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class)
+ public void testH5Sselect_project_intersection_invalid() throws Throwable {
+ H5.H5Sselect_project_intersection(-1, -1, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Scombine_hyperslab_invalid() throws Throwable {
+ long start[] = new long[2];
+ long count[] = new long[2];
+ H5.H5Scombine_hyperslab(-1, 0, start, null, count, null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Scombine_hyperslab_null_start() throws Throwable {
+ long sid = -1;
+ long start[] = null;
+ long stride[] = null;
+ long count[] = new long[2];
+ long block[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Scombine_hyperslab_null_count() throws Throwable {
+ long sid = -1;
+ long start[] = new long[2];
+ long stride[] = null;
+ long count[] = null;
+ long block[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Smodify_select_invalid() throws Throwable {
+ H5.H5Smodify_select(-1, 0, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Scombine_select_invalid() throws Throwable {
+ H5.H5Scombine_select(-1, 0, -1);
+ }
+
}
diff --git a/java/test/testfiles/JUnit-TestH5Sbasic.txt b/java/test/testfiles/JUnit-TestH5Sbasic.txt
index 707878e..3422442 100644
--- a/java/test/testfiles/JUnit-TestH5Sbasic.txt
+++ b/java/test/testfiles/JUnit-TestH5Sbasic.txt
@@ -5,18 +5,32 @@ JUnit version 4.11
.testH5Sdecode_null
.testH5Screate_simple_dims_exceed
.testH5Screate_simple_unlimted_1d
+.testH5Sselect_intersect_block_rank_start
+.testH5Sget_regular_hyperslab_invalid
+.testH5Sselect_adjust_rank_offset
.testH5Screate_simple_dims_invalid
.testH5Screate_scalar
.testH5Screate_simple
+.testH5Sselect_project_intersection_invalid
.testH5Screate_simple_rank_invalid
.testH5Sget_simple_extent_type_invalid
+.testH5Scombine_hyperslab_invalid
+.testH5Scombine_hyperslab_null_count
+.testH5Scombine_hyperslab_null_start
.testH5Sencode_invalid
.testH5Screate_null
.testH5Screate_simple_extent
.testH5Screate_invalid
+.testH5Sselect_intersect_block_invalid
+.testH5Sselect_adjust_invalid
.testH5Screate_simple_unlimted
+.testH5Sselect_shape_same_invalid
+.testH5Smodify_select_invalid
+.testH5Scombine_select_invalid
+.testH5Sselect_copy_invalid
+.testH5Sselect_intersect_block_rank_end
Time: XXXX
-OK (16 tests)
+OK (30 tests)