summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-04-24 21:44:35 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-04-24 21:44:35 (GMT)
commit9d84abe503267baaf3ddc675a4e3182d7f415be0 (patch)
treec8c6ad68accf6a903f20098b15565311d4b919fb
parent2deb953dbbde17712723529c4bca6a2bf3eedf6b (diff)
parent0fb5ce7ad50664f800ffe7e107e0fb0f90f66e12 (diff)
downloadhdf5-9d84abe503267baaf3ddc675a4e3182d7f415be0.zip
hdf5-9d84abe503267baaf3ddc675a4e3182d7f415be0.tar.gz
hdf5-9d84abe503267baaf3ddc675a4e3182d7f415be0.tar.bz2
Merge pull request #457 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '0fb5ce7ad50664f800ffe7e107e0fb0f90f66e12': Correct name of native function Fix javadoc Fix typo Signature change requires a ptr Change H5PLsize() signature Revert HDFFV-9655 Changed signature of H5PLgetsize Revert HDFFV-9655 by disabling test and not using new function. Fix path to actual executable location Windows ahs one more directory level
-rw-r--r--java/src/hdf/hdf5lib/H5.java6
-rw-r--r--java/src/jni/h5plImp.c10
-rw-r--r--src/H5PL.c16
-rw-r--r--src/H5PLpublic.h12
-rw-r--r--test/CMakeTests.cmake16
-rw-r--r--test/plugin.c23
-rw-r--r--test/test_plugin.sh.in22
7 files changed, 62 insertions, 43 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 23e2a34..5e13fdf 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -2895,7 +2895,8 @@ public class H5 implements java.io.Serializable {
* @param file_id
* IN: Identifier of the target file.
*
- * @param mdc_logging_status, the status
+ * @param mdc_logging_status
+ * the status
* mdc_logging_status[0] = is_enabled, whether logging is enabled
* mdc_logging_status[1] = is_currently_logging, whether events are currently being logged
*
@@ -5813,7 +5814,8 @@ public class H5 implements java.io.Serializable {
*
* @param fapl_id
* IN: File access property list identifier
- * @param mdc_log_options, the options
+ * @param mdc_log_options
+ * the options
* mdc_logging_options[0] = is_enabled, whether logging is enabled
* mdc_logging_options[1] = start_on_access, whether the logging begins as soon as the file is opened or created
*
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index 09a1032..9b6100e 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -213,13 +213,11 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5PLsize
(JNIEnv *env, jclass clss)
{
- int retVal = -1;
-
- retVal = H5PLsize();
- if (retVal < 0)
+ unsigned int listsize = 0;
+ if (H5PLsize(&listsize) < 0) {
h5libraryError(env);
-
- return (jint)retVal;
+ }
+ return (jint)listsize;
} /* end Java_hdf_hdf5lib_H5_H5PLsize */
#ifdef __cplusplus
diff --git a/src/H5PL.c b/src/H5PL.c
index 2789a5e..ba10e5a 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -720,17 +720,19 @@ done:
*
* Purpose: Query the size of the current list of plugin paths.
*
- * Return: Plugin path size (can't indicate failure due to unsigned type)
+ * Return: Plugin path size
*
*-------------------------------------------------------------------------
*/
-unsigned int
-H5PLsize(void)
+herr_t
+H5PLsize(unsigned int *listsize)
{
- unsigned int ret_value = (unsigned int)H5PL_num_paths_g;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE1("e", "*Iu", listsize);
- FUNC_ENTER_API(0)
- H5TRACE0("Iu","");
+ *listsize = (unsigned int)H5PL_num_paths_g;
done:
FUNC_LEAVE_API(ret_value)
@@ -778,7 +780,7 @@ H5PL__init_path_table(void)
/* Check for too many directories in path */
if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM)
HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table")
- if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5PL__env_strdup(dir)))
+ if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dir)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
H5PL_num_paths_g++;
dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR);
diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h
index 5e4dcae..12cdc87 100644
--- a/src/H5PLpublic.h
+++ b/src/H5PLpublic.h
@@ -43,14 +43,14 @@ extern "C" {
/* plugin state */
H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type);
-H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/);
-H5_DLL herr_t H5PLappend(const char* plugin_path);
-H5_DLL herr_t H5PLprepend(const char* plugin_path);
-H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index);
-H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index);
+H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_type/*out*/);
+H5_DLL herr_t H5PLappend(const char *plugin_path);
+H5_DLL herr_t H5PLprepend(const char *plugin_path);
+H5_DLL herr_t H5PLreplace(const char *plugin_path, unsigned int index);
+H5_DLL herr_t H5PLinsert(const char *plugin_path, unsigned int index);
H5_DLL herr_t H5PLremove(unsigned int index);
H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size);
-H5_DLL unsigned int H5PLsize(void);
+H5_DLL herr_t H5PLsize(unsigned int *listsize/*out*/);
#ifdef __cplusplus
}
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 86c5cb3..6eee237 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -986,8 +986,10 @@ endif ()
##############################################################################
if (WIN32)
set (CMAKE_SEP "\;")
+ set (BIN_REL_PATH "../../")
else ()
set (CMAKE_SEP ":")
+ set (BIN_REL_PATH "../")
endif ()
add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>)
@@ -996,11 +998,15 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
)
-add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>)
-set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES
- ENVIRONMENT "HDF5_PLUGIN_PATH=@/../testdir1${CMAKE_SEP}@/../testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
-)
+##############################################################################
+# HDFFV-9655 relative plugin test disabled
+#
+#add_test (NAME H5PLUGIN-pluginRelative COMMAND $<TARGET_FILE:plugin>)
+#set_tests_properties (H5PLUGIN-pluginRelative PROPERTIES
+# ENVIRONMENT "HDF5_PLUGIN_PATH=@/${BIN_REL_PATH}testdir1${CMAKE_SEP}@/${BIN_REL_PATH}testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
+# WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
+#)
+##############################################################################
##############################################################################
### S W M R T E S T S
diff --git a/test/plugin.c b/test/plugin.c
index 2939595..862f99d 100644
--- a/test/plugin.c
+++ b/test/plugin.c
@@ -733,7 +733,7 @@ test_filter_path_apis(void)
if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR
- ndx = H5PLsize();
+ H5PLsize(&ndx);
TESTING(" remove");
/* Remove all existing paths*/
@@ -743,7 +743,8 @@ test_filter_path_apis(void)
TEST_ERROR
} /* end if */
/* Verify the table is empty */
- if(H5PLsize() > 0) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx > 0) TEST_ERROR
PASSED();
TESTING(" remove (exceed min)");
@@ -764,7 +765,8 @@ test_filter_path_apis(void)
}
}
/* Verify the table is full */
- if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR
PASSED();
TESTING(" append (exceed)");
@@ -835,7 +837,8 @@ test_filter_path_apis(void)
PASSED();
/* Verify the table is not full */
- if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR
+ H5PLsize(&ndx);
+ if (ndx != H5PL_MAX_PATH_NUM - 1) TEST_ERROR
TESTING(" prepend");
/* Prepend one path*/
@@ -846,7 +849,8 @@ test_filter_path_apis(void)
}
/* Verify the table is full */
- if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR
/* Verify that the entries were moved */
if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR
@@ -880,7 +884,8 @@ test_filter_path_apis(void)
}
/* Verify the table is full */
- if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR
/* Verify that the entries were not moved */
if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR
@@ -909,7 +914,8 @@ test_filter_path_apis(void)
PASSED();
/* Verify the table is not full */
- if(H5PLsize() != 15) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx != 15) TEST_ERROR
TESTING(" insert");
/* Insert one path*/
@@ -928,7 +934,8 @@ test_filter_path_apis(void)
PASSED();
/* Verify the table is full */
- if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+ H5PLsize(&ndx);
+ if(ndx != H5PL_MAX_PATH_NUM) TEST_ERROR
TESTING(" insert (exceed)");
/* Exceed the max path insert */
diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in
index 37d4462..4cddbb0 100644
--- a/test/test_plugin.sh.in
+++ b/test/test_plugin.sh.in
@@ -87,23 +87,27 @@ if [ $? != 0 ]; then
nerrors=`expr $nerrors + 1`
fi
+############################################
+# HDFFV-9655 test for relative path disabled
# setup plugin path relative to test
-ENVCMD="env HDF5_PLUGIN_PATH=@/${PLUGIN_LIBDIR1}:@/${PLUGIN_LIBDIR2}"
-
+# actual executable is in the .libs folder
+#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_LIBDIR1}:@/../${PLUGIN_LIBDIR2}"
+#
# Run the test
#$ENVCMD $TEST_BIN
#if [ $? != 0 ]; then
# nerrors=`expr $nerrors + 1`
#fi
+#############################################
# print results
-#if test $nerrors -ne 0 ; then
-# echo "$nerrors errors encountered"
-# exit_code=$EXIT_FAILURE
-#else
-# echo "All Plugin API tests passed."
-# exit_code=$EXIT_SUCCESS
-#fi
+if test $nerrors -ne 0 ; then
+ echo "$nerrors errors encountered"
+ exit_code=$EXIT_FAILURE
+else
+ echo "All Plugin API tests passed."
+ exit_code=$EXIT_SUCCESS
+fi
# Clean up temporary files/directories and leave
$RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2