diff options
| author | kmu <kmu@hdfgroup.org> | 2020-01-24 18:05:09 (GMT) |
|---|---|---|
| committer | kmu <kmu@hdfgroup.org> | 2020-01-24 18:05:09 (GMT) |
| commit | fb6328b6315d62aed57a98058c711ef086aa0db1 (patch) | |
| tree | bb85224bcdcb2826bfe98b7b80b756613b65788a /java/test/TestH5VL.java | |
| parent | e938f4407eeea3f55dc5df291a2a83854f54404a (diff) | |
| parent | 590aaff33046df99a4d88ba59e4b461e060b36e4 (diff) | |
| download | hdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.zip hdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.tar.gz hdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.tar.bz2 | |
Merge branch 'develop' of https://git.hdfgroup.org/scm/~kmu/hdf5 into develop
Diffstat (limited to 'java/test/TestH5VL.java')
| -rw-r--r-- | java/test/TestH5VL.java | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java index 0397be1..d774dbb 100644 --- a/java/test/TestH5VL.java +++ b/java/test/TestH5VL.java @@ -69,14 +69,46 @@ public class TestH5VL { @Test public void testH5VLget_connector_id() { + String H5_FILE = "testFvl.h5"; + + long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, + HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + + try { + long native_id = H5.H5VLget_connector_id(H5fid); + assertTrue("H5.H5VLget_connector_id", native_id >= 0); + + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector. Only check for the native connector + * if this isn't set. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertEquals(HDF5Constants.H5VL_NATIVE, native_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5VLget_connector_id " + err); + } + finally { + if (H5fid > 0) { + try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + } + _deleteFile(H5_FILE); + } + } + + @Test + public void testH5VLget_connector_id_by_name() { try { - long native_id = H5.H5VLget_connector_id(HDF5Constants.H5VL_NATIVE_NAME); - assertTrue("H5.H5VLget_connector_id H5VL_NATIVE_NAME", native_id >= 0); + long native_id = H5.H5VLget_connector_id_by_name(HDF5Constants.H5VL_NATIVE_NAME); + assertTrue("H5.H5VLget_connector_id_by_name H5VL_NATIVE_NAME", native_id >= 0); assertEquals(HDF5Constants.H5VL_NATIVE, native_id); } catch (Throwable err) { err.printStackTrace(); - fail("H5.H5VLget_connector_id " + err); + fail("H5.H5VLget_connector_id_by_name " + err); } } @@ -90,7 +122,15 @@ public class TestH5VL { try { String native_name = H5.H5VLget_connector_name(H5fid); - assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0); + + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector. Only check for the native connector + * if this isn't set. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0); } catch (Throwable err) { err.printStackTrace(); |
