Primary change is HDFFV-11212 - new refs and JNI (#372)

* OESS-98 convert plugin option to FetchContent, add tests

* Fixes for pkcfg files because of plugin option

* OESS-98 fix tools test for plugins

* Keep doxygen comments under 100 chars long - format hint

* Whitespace

* HDFFV-11144 - Reclassify CMake messages

* HDFFV-11099/11100 added help text

* Reworked switch statement to compare string instead

* Fix typo

* Update CDash mode

* Correct name of threadsafe

* Correct option name

* Undo accidental commit

* Note LLVM 10 to 11 format default changes

* Update format plugin

* Undo clang-format version 11 changes

* One more correction

* Update supported platforms

* Revert whitespace changes

* Correct whitespace

* Changes from PR#3

* HDFFV-11213 added option to control gcc10 warnings diagnostics

* HDFFV-11212 Use the new references correctly in JNI utility and tests

* format source

* Fix typo

* Add new test file

* HDFFV-11212 - update test and remove unused arg

* Minor non-space formatting changes

* Use H5I_INVALID_ID instead of "-1"

* source formatting

* add missing testfile, update jni function

* Undo commit of debug code

* remove mislocated file

* Fix h5repack test for handling of fapls and id close

* Update h5diff test files usage text

* HDFFV-11212 add new ref tests for JNI export dataset

* src format update

* Remove blank line typo

* src format typo

* long double requires %Lg

* Another long double foramt specifer S.B. %Lg

* issue with t128bit test

* Windows issue with h5dump and type.

* Fix review issues

* refactor function nesting and fix error checks

* format fixes

* Remove untested functions and javadoc quiet comments

* Restore TRY block.

* Change string append errors to memory exception

* revert to H5_JNI_FATAL_ERROR - support functions need work

* Add assertion error for h5util functions

* remove duplicate function

* format fix

* Revert HD function error handling

* Update copyright comments
This commit is contained in:
Allen Byrne
2021-02-25 15:12:57 -06:00
committed by GitHub
parent c29e1b9fdf
commit c7ffe683e5
123 changed files with 2671 additions and 1300 deletions

View File

@@ -43,14 +43,14 @@ public class TestH5A {
private static final String H5_FILE = "testA.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
long H5fid = -1;
long H5dsid = -1;
long H5did = -1;
long H5fid = HDF5Constants.H5I_INVALID_HID;
long H5dsid = HDF5Constants.H5I_INVALID_HID;
long H5did = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
long type_id = -1;
long space_id = -1;
long lapl_id = -1;
long aapl_id = -1;
long type_id = HDF5Constants.H5I_INVALID_HID;
long space_id = HDF5Constants.H5I_INVALID_HID;
long lapl_id = HDF5Constants.H5I_INVALID_HID;
long aapl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -61,7 +61,7 @@ public class TestH5A {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
long did = -1;
long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -132,7 +132,7 @@ public class TestH5A {
@Test
public void testH5Acreate2() {
long attr_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
assertTrue("testH5Acreate2", attr_id >= 0);
@@ -160,8 +160,8 @@ public class TestH5A {
@Test
public void testH5Aopen() {
String attr_name = "dset";
long attribute_id = -1;
long attr_id = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, attr_name, type_id, space_id,
@@ -197,8 +197,8 @@ public class TestH5A {
int idx_type = HDF5Constants.H5_INDEX_CRT_ORDER;
int order = HDF5Constants.H5_ITER_INC;
long n = 0;
long attr_id = -1;
long attribute_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "file", type_id, space_id,
@@ -256,7 +256,7 @@ public class TestH5A {
public void testH5Acreate_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
long attribute_id = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
boolean bool_val = false;
try {
@@ -288,7 +288,7 @@ public class TestH5A {
long loc_id = H5fid;
String old_attr_name = "old";
String new_attr_name = "new";
long attr_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -326,7 +326,7 @@ public class TestH5A {
String obj_name = ".";
String old_attr_name = "old";
String new_attr_name = "new";
long attr_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -368,7 +368,7 @@ public class TestH5A {
String obj_name = ".";
String attr_name = "DATASET1";
String ret_name = null;
long attribute_id = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -398,8 +398,8 @@ public class TestH5A {
int idx_type = HDF5Constants.H5_INDEX_NAME;
int order = HDF5Constants.H5_ITER_INC;
int n = 0;
long attr1_id = -1;
long attr2_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(loc_id, obj_name, attr_name,
@@ -435,8 +435,8 @@ public class TestH5A {
@Test
public void testH5Aget_storage_size() {
long attr_id = -1;
long attr_size = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
long attr_size = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -458,8 +458,8 @@ public class TestH5A {
@Test
public void testH5Aget_info() {
H5A_info_t attr_info = null;
long attribute_id = -1;
long attr_id = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -490,8 +490,8 @@ public class TestH5A {
@Test
public void testH5Aget_info1() {
H5A_info_t attr_info = null;
long attribute_id = -1;
long attr_id = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
long attr_id = HDF5Constants.H5I_INVALID_HID;
int order = HDF5Constants.H5_ITER_INC;
try {
@@ -526,8 +526,8 @@ public class TestH5A {
@Test
public void testH5Aget_info_by_idx() {
long attr_id = -1;
long attr2_id = -1;;
long attr_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;;
H5A_info_t attr_info = null;
try {
@@ -582,7 +582,7 @@ public class TestH5A {
@Test
public void testH5Aget_info_by_name() {
long attr_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
H5A_info_t attr_info = null;
String obj_name = ".";
String attr_name = "DATASET";
@@ -607,7 +607,7 @@ public class TestH5A {
@Test
public void testH5Adelete_by_name() {
long attr_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
boolean exists = false;
@@ -650,8 +650,8 @@ public class TestH5A {
@Test
public void testH5Aexists() {
boolean exists = false;
long attr_id = -1;
long attribute_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
exists = H5.H5Aexists(H5fid, "None");
@@ -689,10 +689,10 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_order() {
boolean exists = false;
long attr1_id = -1;
long attr2_id = -1;
long attr3_id = -1;
long attr4_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
long attr3_id = HDF5Constants.H5I_INVALID_HID;
long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -731,9 +731,9 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_name1() {
boolean exists = false;
long attr1_id = -1;
long attr2_id = -1;
long attr3_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
long attr3_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -766,10 +766,10 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_name2() {
boolean exists = false;
long attr1_id = -1;
long attr2_id = -1;
long attr3_id = -1;
long attr4_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
long attr3_id = HDF5Constants.H5I_INVALID_HID;
long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -821,8 +821,8 @@ public class TestH5A {
public void testH5Aopen_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
long attribute_id = -1;
long aid = -1;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
long aid = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -856,9 +856,9 @@ public class TestH5A {
@Test
public void testH5Awrite_readVL() {
String attr_name = "VLdata";
long attr_id = -1;
long atype_id = -1;
long aspace_id = -1;
long attr_id = HDF5Constants.H5I_INVALID_HID;
long atype_id = HDF5Constants.H5I_INVALID_HID;
long aspace_id = HDF5Constants.H5I_INVALID_HID;
String[] str_data = { "Parting", "is such", "sweet", "sorrow." };
long[] dims = { str_data.length };
long lsize = 1;
@@ -923,8 +923,8 @@ public class TestH5A {
public void testH5Aget_create_plist() {
String attr_name = "DATASET1";
int char_encoding = 0;
long plist_id = -1;
long attribute_id = -1;
long plist_id = HDF5Constants.H5I_INVALID_HID;
long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
plist_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_CREATE);
@@ -984,10 +984,10 @@ public class TestH5A {
@Test
public void testH5Aiterate() {
long attr1_id = -1;
long attr2_id = -1;
long attr3_id = -1;
long attr4_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
long attr3_id = HDF5Constants.H5I_INVALID_HID;
long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;
@@ -1052,10 +1052,10 @@ public class TestH5A {
@Test
public void testH5Aiterate_by_name() {
long attr1_id = -1;
long attr2_id = -1;
long attr3_id = -1;
long attr4_id = -1;
long attr1_id = HDF5Constants.H5I_INVALID_HID;
long attr2_id = HDF5Constants.H5I_INVALID_HID;
long attr3_id = HDF5Constants.H5I_INVALID_HID;
long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;