HDFFV-10297 update calls to H5Zfilter_avail

This commit is contained in:
Allen Byrne 2017-10-09 17:00:15 -05:00
parent 66990bc90f
commit c577a5e995
5 changed files with 1338 additions and 1450 deletions

View File

@ -637,10 +637,11 @@ H5Z_filter_avail(H5Z_filter_t id)
if(H5Z_table_g[i].id == id)
HGOTO_DONE(TRUE)
if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id)))
if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) {
if(H5Z_register(filter_info) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter")
HGOTO_DONE(TRUE)
}
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_filter_avail() */

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ static void print_warning(const char *dname, const char *fname)
int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */
hid_t dcpl_id) /* dataset creation property list */
{
int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
int nfilters; /* number of filters */
H5Z_filter_t filtn; /* filter identification number */
int i; /* index */
@ -47,16 +47,16 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
/* get information about filters */
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
return -1;
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed");
/* if we do not have filters, we can read the dataset safely */
if (!nfilters)
return 1;
HGOTO_DONE(1);
/* check availability of filters */
for (i = 0; i < nfilters; i++) {
if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0)
return -1;
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed");
switch (filtn) {
/*-------------------------------------------------------------------------
@ -64,12 +64,13 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
*-------------------------------------------------------------------------
*/
default:
if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0)
return -1;
else if (udfilter_avail == 0) {
if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) {
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zfilter_avail failed");
}
else if (!udfilter_avail) {
if (name)
print_warning(name, "user defined");
return 0;
ret_value = 0;
}
break;
@ -81,7 +82,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
#ifndef H5_HAVE_FILTER_DEFLATE
if (name)
print_warning(name,"deflate");
return 0;
ret_value = 0;
#endif
break;
/*-------------------------------------------------------------------------
@ -92,7 +93,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
#ifndef H5_HAVE_FILTER_SZIP
if (name)
print_warning(name,"SZIP");
return 0;
ret_value = 0;
#endif
break;
/*-------------------------------------------------------------------------
@ -122,7 +123,8 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
}/*switch*/
}/*for*/
return 1;
done:
return ret_value;
}
/*-------------------------------------------------------------------------

View File

@ -19,9 +19,10 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
#add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
endif ()
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
@ -46,5 +47,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
"$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
"${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
include (CMakeTests.cmake)
include (CMakeTests.cmake)

View File

@ -501,7 +501,7 @@
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@ -516,7 +516,7 @@
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@ -546,7 +546,7 @@
add_test (
NAME H5DIFF_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}_ERR.out"
@ -562,7 +562,7 @@
add_test (
NAME H5DIFF_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}_ERR.out"
@ -1653,8 +1653,10 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2})
##############################################################################
### P L U G I N T E S T S
##############################################################################
ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
if (BUILD_SHARED_LIBS)
ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
endif ()
# ##############################################################################
# # END