diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-06-24 22:31:56 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-06-24 22:31:56 (GMT) |
commit | 1d8f7bf297100ec11204442708a7f670a89f3f02 (patch) | |
tree | 366a04e004fad17430077042db6679d6f006ff09 /java/test/TestH5A.java | |
parent | c89696e9650b952ba3a3556c7f33d776238f94d0 (diff) | |
parent | f4015bed9e7ee43468240e734232f9114b749d4f (diff) | |
download | hdf5-1d8f7bf297100ec11204442708a7f670a89f3f02.zip hdf5-1d8f7bf297100ec11204442708a7f670a89f3f02.tar.gz hdf5-1d8f7bf297100ec11204442708a7f670a89f3f02.tar.bz2 |
Merge pull request #1771 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:H5A_java_test_fix to develop
* commit 'f4015bed9e7ee43468240e734232f9114b749d4f':
Updated the Java attribute test so that attribute access property lists are created and used correctly.
Diffstat (limited to 'java/test/TestH5A.java')
-rw-r--r-- | java/test/TestH5A.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java index 536364c..7d336e1 100644 --- a/java/test/TestH5A.java +++ b/java/test/TestH5A.java @@ -50,6 +50,7 @@ public class TestH5A { long type_id = -1; long space_id = -1; long lapl_id = -1; + long aapl_id = -1; private final void _deleteFile(String filename) { File file = new File(filename); @@ -90,8 +91,10 @@ public class TestH5A { assertTrue("TestH5A.createH5file: _createDataset: ", H5did > 0); space_id = H5.H5Screate(HDF5Constants.H5S_NULL); assertTrue(space_id > 0); - lapl_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_ACCESS); + lapl_id = H5.H5Pcreate(HDF5Constants.H5P_LINK_ACCESS); assertTrue(lapl_id > 0); + aapl_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_ACCESS); + assertTrue(aapl_id > 0); type_id = H5.H5Tenum_create(HDF5Constants.H5T_STD_I32LE); assertTrue(type_id > 0); int status = H5.H5Tenum_insert(type_id, "test", 1); @@ -122,6 +125,8 @@ public class TestH5A { try {H5.H5Sclose(space_id);} catch (Exception ex) {} if (lapl_id > 0) try {H5.H5Pclose(lapl_id);} catch (Exception ex) {} + if (aapl_id > 0) + try {H5.H5Pclose(aapl_id);} catch (Exception ex) {} System.out.println(); } @@ -194,7 +199,6 @@ public class TestH5A { long n = 0; long attr_id = -1; long attribute_id = -1; - long aapl_id = HDF5Constants.H5P_DEFAULT; try { attr_id = H5.H5Acreate(H5did, "file", type_id, space_id, @@ -203,7 +207,7 @@ public class TestH5A { // Opening the existing attribute, obj_name(Created by H5ACreate2) // by index, attached to an object identifier. attribute_id = H5.H5Aopen_by_idx(H5did, ".", HDF5Constants.H5_INDEX_CRT_ORDER, HDF5Constants.H5_ITER_INC, - 0, HDF5Constants.H5P_DEFAULT, lapl_id); + 0, aapl_id, lapl_id); assertTrue("testH5Aopen_by_idx: H5Aopen_by_idx", attribute_id >= 0); @@ -258,7 +262,7 @@ public class TestH5A { try { attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, lapl_id); + aapl_id, lapl_id); assertTrue("testH5Acreate_by_name: H5Acreate_by_name", attribute_id >= 0); @@ -289,7 +293,7 @@ public class TestH5A { boolean bool_val = false; try { - attr_id = H5.H5Acreate(loc_id, old_attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, lapl_id); + attr_id = H5.H5Acreate(loc_id, old_attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, aapl_id); ret_val = H5.H5Arename(loc_id, old_attr_name, new_attr_name); @@ -328,7 +332,7 @@ public class TestH5A { try { attr_id = H5.H5Acreate_by_name(loc_id, obj_name, old_attr_name, - type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, lapl_id); + type_id, space_id, HDF5Constants.H5P_DEFAULT, aapl_id, lapl_id); ret_val = H5.H5Arename_by_name(loc_id, obj_name, old_attr_name, new_attr_name, lapl_id); @@ -369,7 +373,7 @@ public class TestH5A { try { attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, lapl_id); + aapl_id, lapl_id); assertTrue("testH5Aget_name: H5Acreate_by_name ", attribute_id > 0); ret_name = H5.H5Aget_name(attribute_id); assertEquals(ret_name, attr_name); |