summaryrefslogtreecommitdiffstats
path: root/java/test/TestH5P.java
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
commit0313cbb91d974b153dbe8747d193ac3c619eea3b (patch)
treeaf6c4a631d5753685ee0033a6a8415a25fc97672 /java/test/TestH5P.java
parent847d675f2743ec420ef6c9efdd6e52ae93b4fe44 (diff)
downloadhdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.zip
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.gz
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.bz2
Final merge of page buffering branch to develop
Diffstat (limited to 'java/test/TestH5P.java')
-rw-r--r--java/test/TestH5P.java41
1 files changed, 28 insertions, 13 deletions
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index b8a4376..fa8b525 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -1198,25 +1198,40 @@ public class TestH5P {
}
@Test
- public void testH5P_file_space() {
+ public void testH5P_file_space_strategy() {
long[] threshold = {0};
- int[] strategy = {0};
+ boolean[] persist = {false};
+ int strategy = 0;
try {
- H5.H5Pget_file_space(fcpl_id, strategy, threshold);
- assertTrue("strategy: "+strategy[0], strategy[0] == HDF5Constants.H5F_FILE_SPACE_ALL);
+ strategy = H5.H5Pget_file_space_strategy(fcpl_id, persist, threshold);
+ assertTrue("strategy(default): "+strategy, strategy == HDF5Constants.H5F_FSPACE_STRATEGY_FSM_AGGR);
+ assertTrue("persist(default): "+persist[0], persist[0] == false);
+ assertTrue("theshold(default): "+threshold[0], threshold[0] == 1);
+ H5.H5Pset_file_space_strategy(fcpl_id, HDF5Constants.H5F_FSPACE_STRATEGY_PAGE, true, 1);
+ strategy = H5.H5Pget_file_space_strategy(fcpl_id, persist, threshold);
+ assertTrue("strategy: "+strategy, strategy == HDF5Constants.H5F_FSPACE_STRATEGY_PAGE);
+ assertTrue("persist: "+persist[0], persist[0] == true);
assertTrue("theshold: "+threshold[0], threshold[0] == 1);
- H5.H5Pset_file_space(fcpl_id, HDF5Constants.H5F_FILE_SPACE_ALL_PERSIST, 10);
- H5.H5Pget_file_space(fcpl_id, strategy, threshold);
- assertTrue("strategy: "+strategy[0], strategy[0] == HDF5Constants.H5F_FILE_SPACE_ALL_PERSIST);
- assertTrue("theshold: "+threshold[0], threshold[0] == 10);
- H5.H5Pset_file_space(fcpl_id, HDF5Constants.H5F_FILE_SPACE_VFD, 0);
- H5.H5Pget_file_space(fcpl_id, strategy, threshold);
- assertTrue("strategy: "+strategy[0], strategy[0] == HDF5Constants.H5F_FILE_SPACE_VFD);
- assertTrue("theshold: "+threshold[0], threshold[0] == 10);
}
catch (Throwable err) {
err.printStackTrace();
- fail("testH5P_file_space: " + err);
+ fail("testH5P_file_space_strategy: " + err);
+ }
+ }
+
+ @Test
+ public void testH5P_file_space_page_size() {
+ long page_size = 0;
+ try {
+ page_size = H5.H5Pget_file_space_page_size(fcpl_id);
+ assertTrue("page_size(default): "+page_size, page_size == 4096);
+ H5.H5Pset_file_space_page_size(fcpl_id, 512);
+ page_size = H5.H5Pget_file_space_page_size(fcpl_id);
+ assertTrue("page_size: "+page_size, page_size == 512);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5P_file_space_page_size: " + err);
}
}
}