summaryrefslogtreecommitdiffstats
path: root/java/test/TestH5Fparams.java
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-01-04 18:52:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-01-04 18:52:37 (GMT)
commit28d5d987b5f7531f5709e65fa731b3972413ddb8 (patch)
treee49cf44830dab5d8fd4c691d1bc06e4b764425b2 /java/test/TestH5Fparams.java
parent46bf1647d40bfab34f4d7726cbd8ae9668d1759f (diff)
downloadhdf5-28d5d987b5f7531f5709e65fa731b3972413ddb8.zip
hdf5-28d5d987b5f7531f5709e65fa731b3972413ddb8.tar.gz
hdf5-28d5d987b5f7531f5709e65fa731b3972413ddb8.tar.bz2
HDFFV-10664 add missing function and check for restriction
Diffstat (limited to 'java/test/TestH5Fparams.java')
-rw-r--r--java/test/TestH5Fparams.java40
1 files changed, 39 insertions, 1 deletions
diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java
index 3d64aa9..8a60f30 100644
--- a/java/test/TestH5Fparams.java
+++ b/java/test/TestH5Fparams.java
@@ -195,7 +195,7 @@ public class TestH5Fparams {
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- fail("H5.H5Fopen: " + err);
+ fail("H5.H5Fcreate: " + err);
}
try {
@@ -215,4 +215,42 @@ public class TestH5Fparams {
try {H5.H5Fclose(fid);} catch (Exception ex) {}
}
}
+
+ @Test(expected = HDF5FunctionArgumentException.class)
+ public void testH5Fset_libver_bounds_invalidlow() throws Throwable {
+ long fid = -1;
+
+ try {
+ try {
+ fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
+ HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ fail("H5.H5Fcreate: " + err);
+ }
+ H5.H5Fset_libver_bounds(fid, 5, HDF5Constants.H5F_LIBVER_LATEST);
+ }
+ finally {
+ try {H5.H5Fclose(fid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = HDF5FunctionArgumentException.class)
+ public void testH5Fset_libver_bounds_invalidhigh() throws Throwable {
+ long fid = -1;
+
+ try {
+ try {
+ fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
+ HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ fail("H5.H5Fcreate: " + err);
+ }
+ H5.H5Fset_libver_bounds(fid, HDF5Constants.H5F_LIBVER_V110, HDF5Constants.H5F_LIBVER_V110+1);
+ }
+ finally {
+ try {H5.H5Fclose(fid);} catch (Exception ex) {}
+ }
+ }
}