From 12b87f0f847dd22e254f40ebbdfb8185b8670a8a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 7 Mar 2017 10:06:38 -0600 Subject: Fix vds tests java wrong call vds test - missing checks and if content --- java/test/JUnit-interface.txt | 3 ++- java/test/TestH5Pvirtual.java | 5 +++-- test/vds.c | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index 7fd80f8..34ec02a 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -530,6 +530,7 @@ JUnit version 4.11 .testH5Pvirtual_storage .testH5Pget_selection_source_dataset .testH5Pget_source_filename +.testH5Pset_get_virtual_printf_gap .testH5Pget_virtual_count .testH5Pset_get_virtual_view .testH5Pget_mapping_parameters @@ -637,7 +638,7 @@ JUnit version 4.11 Time: XXXX -OK (635 tests) +OK (636 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 9372ae1..15fbd03 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -220,6 +220,7 @@ public class TestH5Pvirtual { try {H5.H5Dclose(H5did);} catch (Exception ex) {} } assertTrue("testH5Pget_virtual_count: "+num_map, num_map >= 0); + assertEquals(3, num_map); } @Test @@ -406,7 +407,7 @@ public class TestH5Pvirtual { } } - @Ignore + @Test public void testH5Pset_get_virtual_printf_gap() { long ret_val = -1; H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id); @@ -415,7 +416,7 @@ public class TestH5Pvirtual { assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(0, ret_val); H5.H5Pset_virtual_printf_gap(H5dapl_id, 2); - ret_val = H5.H5Pget_virtual_view(H5dapl_id); + ret_val = H5.H5Pget_virtual_printf_gap(H5dapl_id); assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0); assertEquals(2, ret_val); } diff --git a/test/vds.c b/test/vds.c index 2fd492a..999148c 100644 --- a/test/vds.c +++ b/test/vds.c @@ -2812,7 +2812,7 @@ test_basic_io(unsigned config, hid_t fapl) /* Write data directly to source dataset */ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) - TEST_ERROR + TEST_ERROR /* Close srcdset and srcfile if config option specified */ if(config & TEST_IO_CLOSE_SRC) { @@ -7265,6 +7265,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)2) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7329,6 +7335,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)3) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -7393,6 +7405,12 @@ test_printf(unsigned config, hid_t fapl) if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0) TEST_ERROR + /* Test H5Pget_virtual_printf_gap() */ + if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0) + TEST_ERROR + if(gap_size != (hsize_t)4) + TEST_ERROR + /* Get VDS space */ if((filespace = H5Dget_space(vdset)) < 0) TEST_ERROR @@ -11121,14 +11139,14 @@ error: static int test_dapl_values(hid_t fapl_id) { - hid_t fid = -1; /* file to write to */ - hid_t dcpl_id = -1; /* dataset creation properties */ - hid_t dapl_id1 = -1; /* dataset access properties */ - hid_t dapl_id2 = -1; /* dataset access properties */ - hid_t vds_sid = -1; /* vds data space */ - hid_t src_sid = -1; /* source data space */ - hid_t did1 = -1; /* dataset */ - hid_t did2 = -1; /* dataset */ + hid_t fid = -1; /* file to write to */ + hid_t dcpl_id = -1; /* dataset creation properties */ + hid_t dapl_id1 = -1; /* dataset access properties */ + hid_t dapl_id2 = -1; /* dataset access properties */ + hid_t vds_sid = -1; /* vds data space */ + hid_t src_sid = -1; /* source data space */ + hid_t did1 = -1; /* dataset */ + hid_t did2 = -1; /* dataset */ hsize_t start; /* hyperslab start */ hsize_t stride; /* hyperslab count */ hsize_t count; /* hyperslab count */ @@ -11221,6 +11239,7 @@ test_dapl_values(hid_t fapl_id) if(H5Pget_virtual_printf_gap(dapl_id2, &gap_size) < 0) FAIL_STACK_ERROR if(gap_size != 123) + TEST_ERROR /* Close everything */ if(H5Sclose(vds_sid) < 0) FAIL_STACK_ERROR -- cgit v0.12