summaryrefslogtreecommitdiffstats
path: root/java/test/TestH5E.java
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-09-19 13:58:08 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-09-19 13:58:08 (GMT)
commitcd290ddecb084a4496f57d60ca8db10d8abdf5ee (patch)
treefafc0770e9862526f42fac3d3fa640d179ed3cbe /java/test/TestH5E.java
parentfe418f6c2389122bbab2404046513fac9d6dab7e (diff)
downloadhdf5-cd290ddecb084a4496f57d60ca8db10d8abdf5ee.zip
hdf5-cd290ddecb084a4496f57d60ca8db10d8abdf5ee.tar.gz
hdf5-cd290ddecb084a4496f57d60ca8db10d8abdf5ee.tar.bz2
Add Constants to all ERR STK checks
Diffstat (limited to 'java/test/TestH5E.java')
-rw-r--r--java/test/TestH5E.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 7810c74..a1ca42c 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -37,6 +37,10 @@ import org.junit.rules.TestName;
public class TestH5E {
@Rule public TestName testname = new TestName();
+
+ public static final int ERRSTACK_CNT = 3;
+ public static final int ERRSTACK_MTY_CNT = 0;
+
long hdf_java_classid = -1;
long current_stackid = -1;
@@ -158,7 +162,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 0);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
try {
num_msg = H5.H5Eget_num(current_stackid);
@@ -168,7 +172,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop #:" + num_msg, num_msg == 3);
+ assertTrue("H5.H5Epop #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Epop(current_stackid, 1);
@@ -186,7 +190,7 @@ public class TestH5E {
fail("H5.H5Epop: " + err);
}
- assertTrue("H5.H5Epop", num_msg == 2);
+ assertTrue("H5.H5Epop", num_msg == TestH5E.ERRSTACK_CNT - 1);
}
@Test
@@ -227,7 +231,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 0);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_MTY_CNT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -238,7 +242,7 @@ public class TestH5E {
try {
num_msg = H5.H5Eget_num(estack_id);
- assertTrue("testH5Epush #:" + num_msg, num_msg == 1);
+ assertTrue("testH5Epush #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT + 1);
}
catch (Throwable err) {
err.printStackTrace();
@@ -314,7 +318,7 @@ public class TestH5E {
err.printStackTrace();
fail("testH5Ewalk:H5Eget_num " + err);
}
- assertTrue("testH5Ewalk #:" + num_msg, num_msg == 3);
+ assertTrue("testH5Ewalk #:" + num_msg, num_msg == TestH5E.ERRSTACK_CNT);
try {
H5.H5Ewalk2(current_stackid, HDF5Constants.H5E_WALK_UPWARD, walk_cb, walk_data);