summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-03-24 20:12:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-03-24 20:12:17 (GMT)
commitd121d6112ba153d5939e7461318eab8b66253d7f (patch)
tree07275114242b682877aafaffe6dbe8ca089ac95c
parent674385b72e1987f68e27504b8224c60706d5b835 (diff)
downloadhdf5-d121d6112ba153d5939e7461318eab8b66253d7f.zip
hdf5-d121d6112ba153d5939e7461318eab8b66253d7f.tar.gz
hdf5-d121d6112ba153d5939e7461318eab8b66253d7f.tar.bz2
[svn-r29566] Merge from revise_chunks java changes in rev 29562, 29556, 29561, and add flush/refresh functions
-rw-r--r--MANIFEST2
-rw-r--r--config/cmake/jrunTest.cmake56
-rw-r--r--config/cmake_ext_mod/runTest.cmake28
-rw-r--r--java/src/hdf/hdf5lib/H5.java139
-rw-r--r--java/src/jni/h5dImp.c24
-rw-r--r--java/src/jni/h5dImp.h16
-rw-r--r--java/src/jni/h5gImp.c24
-rw-r--r--java/src/jni/h5gImp.h16
-rw-r--r--java/src/jni/h5oImp.c24
-rw-r--r--java/src/jni/h5oImp.h16
-rw-r--r--java/src/jni/h5pImp.c46
-rw-r--r--java/src/jni/h5pImp.h17
-rw-r--r--java/src/jni/h5tImp.c24
-rw-r--r--java/src/jni/h5tImp.h16
-rw-r--r--java/test/CMakeLists.txt19
-rw-r--r--java/test/JUnit-interface.txt11
-rw-r--r--java/test/TestH5Dparams.java10
-rw-r--r--java/test/TestH5Fswmr.java29
-rw-r--r--java/test/TestH5Gbasic.java10
-rw-r--r--java/test/TestH5Oparams.java10
-rw-r--r--java/test/TestH5P.java5
-rw-r--r--java/test/TestH5Tparams.java10
-rw-r--r--java/test/h5ex_g_iterate.orig (renamed from java/test/h5ex_g_iterate.hdf)bin2928 -> 2928 bytes
-rw-r--r--java/test/junit.sh.in34
24 files changed, 518 insertions, 68 deletions
diff --git a/MANIFEST b/MANIFEST
index 3970410..b4b2793 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2872,7 +2872,7 @@
./java/test/junit.sh.in
./java/test/JUnit-interface.txt
./java/test/JUnit-interface.ert
-./java/test/h5ex_g_iterate.hdf
+./java/test/h5ex_g_iterate.orig
./java/test/TestH5.java
./java/test/TestH5A.java
./java/test/TestH5Dparams.java
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake
index 6c9bbdd..59f4c7b 100644
--- a/config/cmake/jrunTest.cmake
+++ b/config/cmake/jrunTest.cmake
@@ -26,7 +26,10 @@ if (NOT TEST_REFERENCE)
endif (NOT TEST_REFERENCE)
if (NOT TEST_ERRREF)
- set (ERROR_APPEND 1)
+ if (NOT SKIP_APPEND)
+ # append error file since skip was not defined
+ set (ERROR_APPEND 1)
+ endif(NOT SKIP_APPEND)
endif (NOT TEST_ERRREF)
if (NOT TEST_LOG_LEVEL)
@@ -60,34 +63,39 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}")
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
- STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
+ STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
endif (TEST_MASK_FILE)
- if (ERROR_APPEND)
- file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
- else (ERROR_APPEND)
+ if (NOT ERROR_APPEND)
+ # append error output to the stdout output file
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
- endif (ERROR_APPEND)
+ else (NOT ERROR_APPEND)
+ # write back to original .err file
+ file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ endif (NOT ERROR_APPEND)
endif (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
if (TEST_MASK_ERROR)
if (NOT TEST_ERRREF)
- file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
- else (NOT TEST_ERRREF)
+ # the error stack has been appended to the output file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ else (NOT TEST_ERRREF)
+ # the error stack remains in the .err file
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif (NOT TEST_ERRREF)
- string (REGEX REPLACE "Time:[^\n]+\n" "Time: XXXX\n" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
- #string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "HDF5 .[1-9]*[.][0-9]*[.][0-9]*[^)]*" "HDF5 (version (number)" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "Time:[^\n]+\n" "Time: XXXX\n" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
+ #string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "HDF5 .[1-9]*[.][0-9]*[.][0-9]*[^)]*" "HDF5 (version (number)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ # write back the changes to the original files
if (NOT TEST_ERRREF)
- file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
- else (NOT TEST_ERRREF)
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+ else (NOT TEST_ERRREF)
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
endif (NOT TEST_ERRREF)
endif (TEST_MASK_ERROR)
@@ -99,6 +107,7 @@ endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
message (STATUS "COMMAND Error: ${TEST_ERROR}")
+# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (WIN32 AND NOT MINGW)
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
@@ -140,7 +149,8 @@ if (NOT TEST_SKIP_COMPARE)
if (NOT ${TEST_RESULT} STREQUAL 0)
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif (NOT ${TEST_RESULT} STREQUAL 0)
-
+
+ # now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
if (WIN32 AND NOT MINGW)
file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
@@ -191,16 +201,16 @@ if (TEST_GREP_COMPARE)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
# TEST_REFERENCE should always be matched
- string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
- string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
+ string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
+ string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
if (${TEST_RESULT} STREQUAL "0")
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
endif (${TEST_RESULT} STREQUAL "0")
- string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
+ string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
if (${TEST_EXPECT} STREQUAL "1")
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
- string (LENGTH "${TEST_MATCH}" TEST_RESULT)
+ string (LENGTH "${TEST_MATCH}" TEST_RESULT)
if (NOT ${TEST_RESULT} STREQUAL "0")
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
endif (NOT ${TEST_RESULT} STREQUAL "0")
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 3b7d949..21a65e6 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -25,6 +25,7 @@ if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE)
message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE)
+# if there is not an error reference file add the error output to the stdout file
if (NOT TEST_ERRREF)
set (ERROR_APPEND 1)
endif (NOT TEST_ERRREF)
@@ -62,11 +63,13 @@ endif (NOT TEST_INPUT)
message (STATUS "COMMAND Result: ${TEST_RESULT}")
+# if the .err file exists and ERRROR_APPEND is enabled
if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+# append the test result status with a predefined text
if (TEST_APPEND)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n")
endif (TEST_APPEND)
@@ -78,31 +81,37 @@ endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
message (STATUS "COMMAND Error: ${TEST_ERROR}")
+# if the output file needs Storage text removed
if (TEST_MASK)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif (TEST_MASK)
+# if the output file needs Modified text removed
if (TEST_MASK_MOD)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif (TEST_MASK_MOD)
+# if the output file or the .err file needs to mask out error stack info
if (TEST_MASK_ERROR)
if (NOT TEST_ERRREF)
+ # the error stack has been appended to the output file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
else ()
+ # the error stack remains in the .err file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif ()
- string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}")
+ # write back the changes to the original files
if (NOT TEST_ERRREF)
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
else ()
@@ -110,12 +119,14 @@ if (TEST_MASK_ERROR)
endif ()
endif (TEST_MASK_ERROR)
+# remove text from the output file
if (TEST_FILTER)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
- string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif (TEST_FILTER)
+# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (WIN32 AND NOT MINGW)
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
@@ -158,6 +169,7 @@ if (NOT TEST_SKIP_COMPARE)
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif (NOT ${TEST_RESULT} STREQUAL 0)
+ # now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
if (WIN32 AND NOT MINGW)
file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 7a14f8c..08589c2 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -2072,6 +2072,31 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Dwrite_VLStrings(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dflush causes all buffers associated with a dataset to be immediately flushed to disk without removing the
+ * data from the cache.
+ *
+ * @param dset_id
+ * IN: Identifier of the dataset to be flushed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Dflush(long dset_id) throws HDF5LibraryException;
+
+ /**
+ * H5Drefresh causes all buffers associated with a dataset to be cleared and immediately re-loaded with updated
+ * contents from disk. This function essentially closes the dataset, evicts all metadata associated with it
+ * from the cache, and then re-opens the dataset. The reopened dataset is automatically re-registered with the same ID.
+ *
+ * @param dset_id
+ * IN: Identifier of the dataset to be refreshed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Drefresh(long dset_id) throws HDF5LibraryException;
+
// /////// unimplemented ////////
// H5_DLL herr_t H5Ddebug(hid_t dset_id);
// herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
@@ -3344,6 +3369,32 @@ public class H5 implements java.io.Serializable {
private synchronized static native long _H5Gopen2(long loc_id, String name, long gapl_id)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Gflush causes all buffers associated with a group to be immediately flushed to disk without
+ * removing the data from the cache.
+ *
+ * @param group_id
+ * IN: Identifier of the group to be flushed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Gflush(long group_id) throws HDF5LibraryException;
+
+ /**
+ * H5Grefresh causes all buffers associated with a group to be cleared and immediately re-loaded
+ * with updated contents from disk. This function essentially closes the group, evicts all metadata
+ * associated with it from the cache, and then re-opens the group. The reopened group is automatically
+ * re-registered with the same ID.
+ *
+ * @param group_id
+ * IN: Identifier of the group to be refreshed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Grefresh(long group_id) throws HDF5LibraryException;
+
// ////////////////////////////////////////////////////////////
// //
// H5I: HDF5 1.8 Identifier Interface API Functions //
@@ -4347,6 +4398,34 @@ public class H5 implements java.io.Serializable {
public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name,
int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Oflush causes all buffers associated with an object to be immediately flushed to disk without removing
+ * the data from the cache. object_id can be any named object associated with an HDF5 file including a
+ * dataset, a group, or a committed datatype.
+ *
+ * @param object_id
+ * IN: Identifier of the object to be flushed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Oflush(long object_id) throws HDF5LibraryException;
+
+ /**
+ * H5Orefresh causes all buffers associated with an object to be cleared and immediately re-loaded with
+ * updated contents from disk. This function essentially closes the object, evicts all metadata associated
+ * with it from the cache, and then re-opens the object. The reopened object is automatically re-registered
+ * with the same ID. object_id can be any named object associated with an HDF5 file including a
+ * dataset, a group, or a committed datatype.
+ *
+ * @param object_id
+ * IN: Identifier of the object to be refreshed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
+
// /////// unimplemented ////////
// ////////////////////////////////////////////////////////////
@@ -5672,6 +5751,40 @@ public class H5 implements java.io.Serializable {
public synchronized static native String H5Pget_mdc_log_options(long fapl_id, boolean[] mdc_log_options)
throws HDF5LibraryException;
+ /**
+ * H5Pget_metadata_read_attempts retrieves the number of read attempts that is set in the file access property list plist_id.
+ *
+ * @param plist_id
+ * IN: File access property list identifier
+ *
+ * @return The number of read attempts.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native long H5Pget_metadata_read_attempts(long plist_id) throws HDF5LibraryException;
+
+ /**
+ * H5Pset_metadata_read_attempts sets the number of reads that the library will try when reading checksummed
+ * metadata in an HDF5 file opened with SWMR access. When reading such metadata, the library will compare the
+ * checksum computed for the metadata just read with the checksum stored within the piece of checksum. When
+ * performing SWMR operations on a file, the checksum check might fail when the library reads data on a system
+ * that is not atomic. To remedy such situations, the library will repeatedly read the piece of metadata until
+ * the check passes or finally fails the read when the allowed number of attempts is reached.
+ *
+ * @param plist_id
+ * IN: File access property list identifier
+ * @param attempts
+ * IN: The number of read attempts which is a value greater than 0.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native void H5Pset_metadata_read_attempts(long plist_id, long attempts)
+ throws HDF5LibraryException;
+
// Dataset creation property list (DCPL) routines //
/**
@@ -9251,6 +9364,32 @@ public class H5 implements java.io.Serializable {
private synchronized static native long _H5Tvlen_create(long base_id) throws HDF5LibraryException;
+ /**
+ * H5Tflush causes all buffers associated with a committed datatype to be immediately flushed to disk
+ * without removing the data from the cache.
+ *
+ * @param dtype_id
+ * IN: Identifier of the committed datatype to be flushed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Tflush(long dtype_id) throws HDF5LibraryException;
+
+ /**
+ * H5Trefresh causes all buffers associated with a committed datatype to be cleared and immediately
+ * re-loaded with updated contents from disk. This function essentially closes the datatype, evicts
+ * all metadata associated with it from the cache, and then re-opens the datatype. The reopened datatype
+ * is automatically re-registered with the same ID.
+ *
+ * @param dtype_id
+ * IN: Identifier of the committed datatype to be refreshed.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Trefresh(long dtype_id) throws HDF5LibraryException;
+
// /////// unimplemented ////////
// H5T_conv_t H5Tfind(int src_id, int dst_id, H5T_cdata_t *pcdata);
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index f70cb5e..9e03051 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -1752,6 +1752,30 @@ Java_hdf_hdf5lib_H5_H5Diterate(JNIEnv *env, jclass clss, jbyteArray buf, jlong b
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Diterate */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Dflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Dflush(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Dflush((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Drefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Drefresh(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Drefresh((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h
index 12078e8..0edabfc 100644
--- a/java/src/jni/h5dImp.h
+++ b/java/src/jni/h5dImp.h
@@ -312,6 +312,22 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dset_1extent
JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Diterate
(JNIEnv*, jclass, jbyteArray, jlong, jlong, jobject, jobject);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Dflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Dflush
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Drefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c
index 632942a..eab0b02 100644
--- a/java/src/jni/h5gImp.c
+++ b/java/src/jni/h5gImp.c
@@ -251,6 +251,30 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx(JNIEnv *env, jclass cls, jlong loc_id,
return create_H5G_info_t(env, group_info);
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Gflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Gflush(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Gflush((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Grefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Grefresh(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Grefresh((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h
index 2b9bc57..e413652 100644
--- a/java/src/jni/h5gImp.h
+++ b/java/src/jni/h5gImp.h
@@ -89,6 +89,22 @@ JNIEXPORT jobject JNICALL Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name
JNIEXPORT jobject JNICALL Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
(JNIEnv*, jclass, jlong, jstring, jint, jint, jlong, jlong);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Gflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Gflush
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Grefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index c38ec9a..60130fc 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -760,6 +760,30 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id, j
return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Oflush(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Oflush((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Orefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Orefresh(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Orefresh((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index e6889b2..a404145 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -168,6 +168,22 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx
(JNIEnv*, jclass, jlong, jstring, jint, jint, jlong, jlong);
+ /*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Oflush
+ * Signature: (J)V
+ */
+ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Oflush
+ (JNIEnv*, jclass, jlong);
+
+ /*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Orefresh
+ * Signature: (J)V
+ */
+ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Orefresh
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index 8ecd81c..5181672 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -2965,16 +2965,10 @@ Java_hdf_hdf5lib_H5_H5Pset_1elink_1acc_1flags(JNIEnv *env, jclass clss, jlong la
{
herr_t retVal = -1;
- if (((unsigned) flags != H5F_ACC_RDWR) &&
- ((unsigned) flags != H5F_ACC_RDONLY) &&
- ((unsigned) flags != H5F_ACC_DEFAULT)) {
- h5badArgument(env, "H5Pset_elink_acc_flags: invalid flags value");
- } /* end if */
- else {
- retVal = H5Pset_elink_acc_flags((hid_t)lapl_id, (unsigned)flags);
- if (retVal < 0)
- h5libraryError(env);
- } /* end else */
+ retVal = H5Pset_elink_acc_flags((hid_t)lapl_id, (unsigned)flags);
+ if (retVal < 0)
+ h5libraryError(env);
+
return (jint) retVal;
} /* end Java_hdf_hdf5lib_H5_H5Pset_1elink_1acc_1flags */
@@ -5501,6 +5495,38 @@ Java_hdf_hdf5lib_H5_H5Piterate(JNIEnv *env, jclass clss, jlong prop_id, jintArra
return status;
} /* end Java_hdf_hdf5lib_H5_H5Piterate */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_metadata_read_attempts
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts(JNIEnv *env, jclass clss, jlong plist_id)
+{
+ unsigned attempts;
+ if (H5Pget_metadata_read_attempts((hid_t)plist_id, &attempts) < 0)
+ h5libraryError(env);
+
+ return (jlong) attempts;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_metadata_read_attempts
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts(JNIEnv *env, jclass clss, jlong plist_id, jlong attempts)
+{
+ if (attempts <= 0) {
+ h5badArgument(env, "H5Pset_metadata_read_attempts: attempts <= 0");
+ } /* end if */
+ else {
+ if(H5Pset_metadata_read_attempts((hid_t)plist_id, (unsigned)attempts) < 0)
+ h5libraryError(env);
+ } /* end else */
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts */
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h
index a06a64f..997a8f1 100644
--- a/java/src/jni/h5pImp.h
+++ b/java/src/jni/h5pImp.h
@@ -1329,6 +1329,23 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pinsert2
JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Piterate
(JNIEnv*, jclass, jlong, jintArray, jobject, jobject);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_metadata_read_attempts
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts
+(JNIEnv *, jclass, jlong);
+
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_metadata_read_attempts
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
+(JNIEnv *, jclass, jlong, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 1f587de..7280aed 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -1582,6 +1582,30 @@ Java_hdf_hdf5lib_H5_H5Tconvert(JNIEnv *env, jclass clss, jlong src_id, jlong dst
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Tconvert */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Tflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Tflush(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Tflush((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Trefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Trefresh(JNIEnv *env, jclass clss, jlong loc_id)
+{
+ if (H5Trefresh((hid_t)loc_id) < 0)
+ h5libraryError(env);
+}
+
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h
index 9755a91..edaca2f 100644
--- a/java/src/jni/h5tImp.h
+++ b/java/src/jni/h5tImp.h
@@ -543,6 +543,22 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Tget_1array_1dims2
JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tconvert
(JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray, jbyteArray, jlong);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Tflush
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Tflush
+ (JNIEnv*, jclass, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Trefresh
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh
+ (JNIEnv*, jclass, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index e45e081..068689b 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -64,7 +64,6 @@ add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET} ${HDF5_JAVA_HDF5_LIB_TARGET})
set_target_properties (${HDF5_JAVA_TEST_LIB_TARGET} PROPERTIES FOLDER test/java)
set (HDF_JAVA_TEST_FILES
- h5ex_g_iterate.hdf
JUnit-interface.txt
JUnit-interface.ert
)
@@ -80,6 +79,13 @@ foreach (h5_file ${HDF_JAVA_TEST_FILES})
)
endforeach (h5_file ${HDF_JAVA_TEST_FILES})
+add_custom_command (
+ TARGET ${HDF5_JAVA_TEST_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig ${PROJECT_BINARY_DIR}/h5ex_g_iterate.hdf
+)
+
if (WIN32)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
else (WIN32)
@@ -98,6 +104,14 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
+ NAME JUnit-interface-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ JUnit-interface.out
+ JUnit-interface.out.err
+)
+
+add_test (
NAME JUnit-interface
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
@@ -107,11 +121,12 @@ add_test (
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
-D "TEST_OUTPUT=JUnit-interface.out"
- -D "TEST_ERRREF=JUnit-interface.ert"
# -D "TEST_LOG_LEVEL=trace"
-D "TEST_EXPECT=0"
+ -D "SKIP_APPEND=1"
-D "TEST_MASK_ERROR=TRUE"
-D "TEST_FILTER:STRING=${testfilter}"
-D "TEST_REFERENCE=JUnit-interface.txt"
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
)
+set_tests_properties (JUnit-interface PROPERTIES DEPENDS "JUnit-interface-clearall-objects")
diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt
index d7cd29d..7fd80f8 100644
--- a/java/test/JUnit-interface.txt
+++ b/java/test/JUnit-interface.txt
@@ -94,6 +94,7 @@ JUnit version 4.11
.testH5Fget_create_plist
.testH5Fget_obj_count
.testH5Fstart_swmr_write
+.testH5Fswmr_read_attempts
.testH5Gget_info_by_name_not_exists
.testH5Gget_info_by_idx_not_exists
.testH5Gget_info_by_name
@@ -106,7 +107,9 @@ JUnit version 4.11
.testH5Gcreate_null
.testH5Gget_info_by_idx_fileid
.testH5Gclose_invalid
+.testH5Gflush_invalid
.testH5Gopen_invalid
+.testH5Grefresh_invalid
.testH5Gget_info_invalid
.testH5Gcreate_invalid
.testH5Gcreate_exists
@@ -233,9 +236,11 @@ JUnit version 4.11
.testH5Tget_nmembers_invalid
.testH5Tarray_create_value_null
.testH5Tset_size_invalid
+.testH5Tflush_invalid
.testH5Tenum_insert_invalid
.testH5Tget_array_dims_null
.testH5Tget_member_index_null
+.testH5Trefresh_invalid
.testH5Tset_sign_invalid
.testH5Tenum_insert_name_null
.testH5Tequal_not
@@ -271,6 +276,8 @@ JUnit version 4.11
.testH5Dvlen_reclaim_invalid
.testH5Dopen_invalid
.testH5Dclose_invalid
+.testH5Dflush_invalid
+.testH5Drefresh_invalid
.testH5Dget_storage_size_invalid
.testH5Dget_space_invalid
.testH5Dopen_null
@@ -566,7 +573,9 @@ JUnit version 4.11
.testH5Oset_comment_by_name_invalid
.testH5Oopen_null
.testH5Oclose_invalid
+.testH5Oflush_invalid
.testH5Oget_comment_by_name_invalid
+.testH5Orefresh_invalid
.testH5Ocopy_null_dest
.testH5Olink_invalid
.testH5Oget_info_by_idx_invalid
@@ -628,7 +637,7 @@ JUnit version 4.11
Time: XXXX
-OK (626 tests)
+OK (635 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/TestH5Dparams.java b/java/test/TestH5Dparams.java
index f056027..2cdd121 100644
--- a/java/test/TestH5Dparams.java
+++ b/java/test/TestH5Dparams.java
@@ -131,4 +131,14 @@ public class TestH5Dparams {
H5.H5Dget_storage_size(-1);
}
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Dflush_invalid() throws Throwable {
+ H5.H5Dflush(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Drefresh_invalid() throws Throwable {
+ H5.H5Drefresh(-1);
+ }
+
}
diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java
index 21c3642..b65ebf2 100644
--- a/java/test/TestH5Fswmr.java
+++ b/java/test/TestH5Fswmr.java
@@ -81,8 +81,6 @@ public class TestH5Fswmr {
@Test
public void testH5Fstart_swmr_write() {
- long plist = -1;
-
try {
H5.H5Fstart_swmr_write(H5fid);
}
@@ -90,4 +88,31 @@ public class TestH5Fswmr {
fail("H5.H5Fstart_swmr_write: " + err);
}
}
+
+ @Test
+ public void testH5Fswmr_read_attempts() {
+ long read_attempts = 0;
+
+ try {
+ read_attempts = H5.H5Pget_metadata_read_attempts(H5fapl);
+ }
+ catch (Throwable err) {
+ fail("H5.testH5Fswmr_read_attempts: " + err);
+ }
+ assertTrue(read_attempts == 1);
+
+ try {
+ H5.H5Pset_metadata_read_attempts(H5fapl, 20);
+ }
+ catch (Throwable err) {
+ fail("H5.testH5Fswmr_read_attempts: " + err);
+ }
+ try {
+ read_attempts = H5.H5Pget_metadata_read_attempts(H5fapl);
+ }
+ catch (Throwable err) {
+ fail("H5.testH5Fswmr_read_attempts: " + err);
+ }
+ assertTrue(read_attempts == 20);
+ }
}
diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java
index 70acef4..b049e15 100644
--- a/java/test/TestH5Gbasic.java
+++ b/java/test/TestH5Gbasic.java
@@ -368,4 +368,14 @@ public class TestH5Gbasic {
assertNotNull(info);
}
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Gflush_invalid() throws Throwable {
+ H5.H5Gflush(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Grefresh_invalid() throws Throwable {
+ H5.H5Grefresh(-1);
+ }
+
}
diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java
index ced66f5..9398940 100644
--- a/java/test/TestH5Oparams.java
+++ b/java/test/TestH5Oparams.java
@@ -151,4 +151,14 @@ public class TestH5Oparams {
H5.H5Oget_comment_by_name(-1, null, -1);
}
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Oflush_invalid() throws Throwable {
+ H5.H5Oflush(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Orefresh_invalid() throws Throwable {
+ H5.H5Orefresh(-1);
+ }
+
}
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index 2a0fc34..b8a4376 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -25,6 +25,7 @@ import java.io.File;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
@@ -496,12 +497,12 @@ public class TestH5P {
assertEquals(HDF5Constants.H5F_ACC_RDWR, get_flags);
}
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = HDF5FunctionArgumentException.class)
public void testH5Pset_elink_acc_flags_InvalidFlag1() throws Throwable {
H5.H5Pset_elink_acc_flags(lapl_id, HDF5Constants.H5F_ACC_TRUNC);
}
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = HDF5FunctionArgumentException.class)
public void testH5Pset_elink_acc_flags_InvalidFlag2() throws Throwable {
H5.H5Pset_elink_acc_flags(lapl_id, -1);
}
diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java
index 15cc6af..4ebeea7 100644
--- a/java/test/TestH5Tparams.java
+++ b/java/test/TestH5Tparams.java
@@ -386,4 +386,14 @@ public class TestH5Tparams {
H5.H5Tget_native_type(-1);
}
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Tflush_invalid() throws Throwable {
+ H5.H5Tflush(-1);
+ }
+
+ @Test(expected = HDF5LibraryException.class)
+ public void testH5Trefresh_invalid() throws Throwable {
+ H5.H5Trefresh(-1);
+ }
+
}
diff --git a/java/test/h5ex_g_iterate.hdf b/java/test/h5ex_g_iterate.orig
index e462703..e462703 100644
--- a/java/test/h5ex_g_iterate.hdf
+++ b/java/test/h5ex_g_iterate.orig
Binary files differ
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 8de07e3..74e8ba9 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -34,6 +34,9 @@ AWK='awk'
nerrors=0
verbose=yes
+# setup my machine information.
+myos=`uname -s`
+
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
BLDLIBDIR="$top_builddir/java/lib"
@@ -61,8 +64,8 @@ $top_builddir/java/src/jni/.libs/libhdf5_java.*
$top_builddir/java/src/$JARFILE
"
LIST_DATA_FILES="
-$HDFTEST_HOME/h5ex_g_iterate.hdf
$HDFTEST_HOME/JUnit-interface.txt
+$HDFTEST_HOME/JUnit-interface.ert
"
expect="JUnit-interface.txt"
@@ -144,23 +147,16 @@ COPY_DATAFILES_TO_BLDDIR()
fi
fi
done
+ $CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterate.hdf
}
CLEAN_DATAFILES_AND_BLDDIR()
{
- # skip rm if srcdir is same as destdir
- # this occurs when build/test performed in source dir and
- # make cp fail
- SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.hdf`
- INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'`
- if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDDIR/*.hdf
- $RM $BLDDIR/*.out
- $RM $BLDDIR/*.err
- $RM $BLDDIR/*.ext
- $RM $BLDDIR/*.txt
- fi
+ $RM $BLDDIR/h5ex_g_iterate.hdf
+ $RM $BLDDIR/JUnit-interface.out
+ $RM $BLDDIR/JUnit-interface.err
+ $RM $BLDDIR/JUnit-interface.ext
+ $RM $BLDDIR/JUnit-interface.txt
}
# Print a line-line message left justified in a field of 70 characters
@@ -239,12 +235,12 @@ sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
$actual_ext > $actual
if $CMP $expect $actual; then
- echo " PASSED"
+ echo " PASSED"
else
- echo "*FAILED*"
- echo " Expected result differs from actual result"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ echo "*FAILED*"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi