summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-10-21 20:12:23 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-10-21 20:12:23 (GMT)
commita33fcdfb6bc7917e42ac4e7dcebd9a94afafc650 (patch)
tree440deb6c50827a0984223991bb835cde8248a5c3 /tools
parentc6e1b8f6aa46c6eb0186c16ac923761b9764b06a (diff)
parent0235ea066df4f60a9fd3f0237eeea5e38b135d69 (diff)
downloadhdf5-a33fcdfb6bc7917e42ac4e7dcebd9a94afafc650.zip
hdf5-a33fcdfb6bc7917e42ac4e7dcebd9a94afafc650.tar.gz
hdf5-a33fcdfb6bc7917e42ac4e7dcebd9a94afafc650.tar.bz2
Merge pull request #85 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit '0235ea066df4f60a9fd3f0237eeea5e38b135d69': Change return statement format Revert "Add defines that are missing on OSX" Add defines that are missing on OSX Revert "merge include chnages from trunk" Revert "Correct signature" Correct signature merge include chnages from trunk Update windows test machine Add h5repack paragraph Correct 1.8 version of reference file Add test for 1.8 version of testlib Add new testlib to makefile Remove attributes Fix reference file value revert back reference file Add new testlib to copy Add new test file for UD filters
Diffstat (limited to 'tools')
-rw-r--r--tools/h5repack/CMakeLists.txt21
-rw-r--r--tools/h5repack/CMakeTests.cmake5
-rw-r--r--tools/h5repack/Makefile.am3
-rw-r--r--tools/h5repack/Makefile.in22
-rw-r--r--tools/h5repack/dynlib_rpk.c34
-rw-r--r--tools/h5repack/dynlib_vrpk.c104
-rw-r--r--tools/h5repack/h5repack.sh.in2
-rw-r--r--tools/h5repack/h5repack_plugin.sh.in55
-rw-r--r--tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl158
-rw-r--r--tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst14
10 files changed, 368 insertions, 50 deletions
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 0e9c28f..f4f48b7 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -51,16 +51,21 @@ if (BUILD_TESTING)
set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
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})
+ set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers")
+ set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}")
+ set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME})
add_definitions (${HDF_EXTRA_C_FLAGS})
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (
- ${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME}
- SHARED ${HDF5_PACKAGE_SOVERSION}
- )
+ H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
+
+ add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
+ TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ")
+ target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED ${HDF5_PACKAGE_SOVERSION})
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -75,6 +80,14 @@ if (BUILD_TESTING)
"$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
"${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
)
+ add_custom_command (
+ TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
+ )
include (CMakeTests.cmake)
diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake
index c7171d8..08420ff 100644
--- a/tools/h5repack/CMakeTests.cmake
+++ b/tools/h5repack/CMakeTests.cmake
@@ -92,6 +92,8 @@
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5.tst
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none.ddl
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst
+ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test.ddl
+ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5.tst
${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst
)
@@ -411,7 +413,7 @@
set (FILE18 h5repack_layout2.h5)
set (FILE_REF h5repack_refs.h5)
set (FILE_ATTR_REF h5repack_attr_refs.h5)
-
+
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK-clearall-objects
@@ -988,6 +990,7 @@
##############################################################################
### P L U G I N T E S T S
##############################################################################
+ ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,1,8,18)
ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9)
ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE)
# check for no parameters
diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am
index 21ac362..5f32d73 100644
--- a/tools/h5repack/Makefile.am
+++ b/tools/h5repack/Makefile.am
@@ -63,8 +63,9 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_
if HAVE_SHARED_CONDITIONAL
# Build it as shared library if configure is enabled for shared library.
- lib_LTLIBRARIES=libdynlibadd.la
+ lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la
libdynlibadd_la_SOURCES=dynlib_rpk.c
+ libdynlibvers_la_SOURCES=dynlib_vrpk.c
install-exec-hook:
$(RM) $(DESTDIR)$(libdir)/*dynlib*
diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in
index 6d1bfd6..ef394ba 100644
--- a/tools/h5repack/Makefile.in
+++ b/tools/h5repack/Makefile.in
@@ -156,6 +156,13 @@ am__v_lt_0 = --silent
am__v_lt_1 =
@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_rpath = -rpath \
@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir)
+libdynlibvers_la_LIBADD =
+am__libdynlibvers_la_SOURCES_DIST = dynlib_vrpk.c
+@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_OBJECTS = \
+@HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_vrpk.lo
+libdynlibvers_la_OBJECTS = $(am_libdynlibvers_la_OBJECTS)
+@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibvers_la_rpath = -rpath \
+@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir)
am__EXEEXT_1 = h5repacktst$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__objects_1 = h5repack.$(OBJEXT) h5repack_copy.$(OBJEXT) \
@@ -214,9 +221,11 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(libdynlibadd_la_SOURCES) $(h5repack_SOURCES) \
- $(h5repacktst_SOURCES) $(testh5repack_detect_szip_SOURCES)
-DIST_SOURCES = $(am__libdynlibadd_la_SOURCES_DIST) $(h5repack_SOURCES) \
+SOURCES = $(libdynlibadd_la_SOURCES) $(libdynlibvers_la_SOURCES) \
+ $(h5repack_SOURCES) $(h5repacktst_SOURCES) \
+ $(testh5repack_detect_szip_SOURCES)
+DIST_SOURCES = $(am__libdynlibadd_la_SOURCES_DIST) \
+ $(am__libdynlibvers_la_SOURCES_DIST) $(h5repack_SOURCES) \
$(h5repacktst_SOURCES) $(testh5repack_detect_szip_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
@@ -711,8 +720,9 @@ COMMON_SOURCES = h5repack.c h5repack_copy.c h5repack_filters.c \
h5repack_SOURCES = $(COMMON_SOURCES) h5repack_main.c
h5repacktst_SOURCES = $(COMMON_SOURCES) h5repacktst.c
testh5repack_detect_szip_SOURCES = testh5repack_detect_szip.c
-@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la
+@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la libdynlibvers.la
@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = dynlib_rpk.c
+@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibvers_la_SOURCES = dynlib_vrpk.c
DISTCLEANFILES = h5repack.sh h5repack_plugin.sh
# Automake needs to be taught how to build lib, progs, and tests targets.
@@ -811,6 +821,9 @@ clean-libLTLIBRARIES:
libdynlibadd.la: $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_DEPENDENCIES) $(EXTRA_libdynlibadd_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(am_libdynlibadd_la_rpath) $(libdynlibadd_la_OBJECTS) $(libdynlibadd_la_LIBADD) $(LIBS)
+
+libdynlibvers.la: $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_DEPENDENCIES) $(EXTRA_libdynlibvers_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(am_libdynlibvers_la_rpath) $(libdynlibvers_la_OBJECTS) $(libdynlibvers_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -898,6 +911,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_rpk.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_vrpk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack_copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack_filters.Po@am__quote@
diff --git a/tools/h5repack/dynlib_rpk.c b/tools/h5repack/dynlib_rpk.c
index 1ccc33a..70333f8 100644
--- a/tools/h5repack/dynlib_rpk.c
+++ b/tools/h5repack/dynlib_rpk.c
@@ -12,10 +12,10 @@
* to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
- * 13 February 2013
+ * Programmer: Raymond Lu
+ * 13 February 2013
*
- * Purpose: Tests the plugin module (H5PL)
+ * Purpose: Tests the plugin module (H5PL)
*/
#include <stdlib.h>
@@ -30,30 +30,30 @@ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts,
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIB1[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB1, /* Filter id number */
+ H5Z_FILTER_DYNLIB1, /* Filter id number */
1, 1, /* Encoding and decoding enabled */
- "dynlib1", /* Filter name for debugging */
+ "dynlib1", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */
+ (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */
}};
H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;}
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_dynlib1
+ * Function: H5Z_filter_dynlib1
*
- * Purpose: A dynlib1 filter method that adds on and subtract from
- * the original value with another value. It will be built
- * as a shared library. plugin.c test will load and use
- * this filter library.
+ * Purpose: A dynlib1 filter method that adds on and subtract from
+ * the original value with another value. It will be built
+ * as a shared library. plugin.c test will load and use
+ * this filter library.
*
- * Return: Success: Data chunk size
+ * Return: Success: Data chunk size
*
- * Failure: 0
+ * Failure: 0
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 29 March 2013
*
*-------------------------------------------------------------------------
@@ -69,12 +69,12 @@ H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts,
/* Check for the correct number of parameters */
if(cd_nelmts == 0)
- return(0);
+ return 0;
/* Check that permanent parameters are set correctly */
if(cd_values[0] > 9)
- return(0);
-
+ return 0;
+
add_on = (int)cd_values[0];
if(flags & H5Z_FLAG_REVERSE) { /*read*/
diff --git a/tools/h5repack/dynlib_vrpk.c b/tools/h5repack/dynlib_vrpk.c
new file mode 100644
index 0000000..97cb211
--- /dev/null
+++ b/tools/h5repack/dynlib_vrpk.c
@@ -0,0 +1,104 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic document set and is *
+ * linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access *
+ * to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*
+ * Purpose: Tests the plugin module (H5PL)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "H5PLextern.h"
+
+#define H5Z_FILTER_DYNLIB4 260
+
+#define PUSH_ERR(func, minor, str) H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str)
+
+static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* This message derives from H5Z */
+const H5Z_class2_t H5Z_DYNLIB4[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIB4, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlib4", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB4;}
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z_filter_dynlib4
+ *
+ * Purpose: A dynlib4 filter method that adds on and subtract from
+ * the original value with another value. It will be built
+ * as a shared library. plugin.c test will load and use
+ * this filter library. Designed to call a HDF function.
+ *
+ * Return: Success: Data chunk size
+ *
+ * Failure: 0
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf)
+{
+ int *int_ptr = (int *)*buf; /* Pointer to the data values */
+ size_t buf_left = *buf_size; /* Amount of data buffer left to process */
+ int add_on = 0;
+ unsigned ver_info[3];
+
+ /* Check for the library version */
+ if(H5get_libversion(&ver_info[0], &ver_info[1], &ver_info[2]) < 0) {
+ PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion");
+ return 0;
+ }
+ /* Check for the correct number of parameters */
+ if(cd_nelmts == 0)
+ return 0;
+
+ /* Check that permanent parameters are set correctly */
+ if(cd_values[0] > 9)
+ return 0;
+
+ if(ver_info[0] != cd_values[1] || ver_info[1] != cd_values[2]) {
+ PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion does not match");
+ return 0;
+ }
+
+ add_on = (int)cd_values[0];
+
+ if(flags & H5Z_FLAG_REVERSE) { /*read*/
+ /* Substract the "add on" value to all the data values */
+ while(buf_left > 0) {
+ *int_ptr++ -= add_on;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end if */
+ else { /*write*/
+ /* Add the "add on" value to all the data values */
+ while(buf_left > 0) {
+ *int_ptr++ += add_on;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end else */
+
+ return nbytes;
+} /* end H5Z_filter_dynlib4() */
+
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 4a32491..de55f20 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -1034,7 +1034,7 @@ TOOLTEST add_alignment $arg
# Check repacking file with old version of layout message (should get upgraded
# to new version and be readable, etc.)
-TOOLTEST pgrade_layout h5repack_layouto.h5
+TOOLTEST upgrade_layout h5repack_layouto.h5
# test for datum size > H5TOOLS_MALLOCSIZE
TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1
diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in
index a064db6..336b3a4 100644
--- a/tools/h5repack/h5repack_plugin.sh.in
+++ b/tools/h5repack/h5repack_plugin.sh.in
@@ -1,16 +1,16 @@
#! /bin/sh
#
-# Copyright by The HDF Group.
-# All rights reserved.
-#
-# This file is part of HDF5. The full HDF5 copyright notice, including
-# terms governing use, modification, and redistribution, is contained in
-# the files COPYING and Copyright.html. COPYING can be found at the root
-# of the source code distribution tree; Copyright.html can be found at the
-# root level of an installed copy of the electronic document set and is
-# linked from the top-level documents page. It can also be found at
-# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access
-# to either file, you may request a copy from help@hdfgroup.org.
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic document set and is
+# linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access
+# to either file, you may request a copy from help@hdfgroup.org.
#
srcdir=@srcdir@
TOP_BUILDDIR=@top_builddir@
@@ -34,6 +34,7 @@ exit_code=$EXIT_SUCCESS
TEST_NAME=ud_plugin
FROM_DIR=`pwd`/.libs
PLUGIN_LIB="$FROM_DIR/libdynlibadd.*"
+PLUGIN_LIB2="$FROM_DIR/libdynlibvers.*"
PLUGIN_LIBDIR=testdir3
RM='rm -rf'
@@ -65,6 +66,8 @@ LIST_HDF5_TEST_FILES="
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl
$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst
+$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_version_test.ddl
+$SRC_H5REPACK_TESTFILES/plugin_version_test.h5repack_layout.h5.tst
"
#$SRC_H5REPACK_TESTFILES/h5repack_layout.UD.h5
#$SRC_H5REPACK_TESTFILES/h5repack_layout.UD.h5-plugin_none.ddl
@@ -90,6 +93,11 @@ if [ $? != 0 ]; then
echo "Failed to copy plugin library ($PLUGIN_LIB) for test."
exit $EXIT_FAILURE
fi
+$CP $PLUGIN_LIB2 $PLUGIN_LIBDIR
+if [ $? != 0 ]; then
+ echo "Failed to copy plugin library ($PLUGIN_LIB2) for test."
+ exit $EXIT_FAILURE
+fi
# setup plugin path
ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}"
@@ -113,7 +121,7 @@ COPY_TESTFILES_TO_TESTDIR()
$CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
-
+
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
@@ -168,11 +176,11 @@ STDOUT_FILTER() {
# cleanup
rm -f $tmp_file
}
-
+
# This runs h5repack comparing output with h5dump output
# from -pH option
#
-TOOLTEST_DUMP()
+TOOLTEST_DUMP()
{
echo $@
infile=$2
@@ -186,7 +194,7 @@ TOOLTEST_DUMP()
shift
shift
-
+
# Run test.
TESTING $H5REPACK $@
(
@@ -209,10 +217,10 @@ TOOLTEST_DUMP()
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && diff -c $expect1 $actual1 |sed 's/^/ /'
fi
- VERIFY h5dump output -pH $outfile
+ VERIFY h5dump output -pH $outfile
(
cd $TESTDIR
- $ENVCMD $H5DUMP_BIN -pH $outfile
+ $ENVCMD $H5DUMP_BIN -pH $outfile
) >$actual2 2>$actual2_err
RET=$?
cat $actual2_err >> $actual2
@@ -225,26 +233,29 @@ TOOLTEST_DUMP()
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && diff -c $expect2 $actual2 |sed 's/^/ /'
fi
-
+
fi
-
+
rm -f $actual1 $actual1_err $actual2 $actual2_err
rm -f $outfile
}
##############################################################################
-### T H E T E S T S
+### T H E T E S T S
##############################################################################
# prepare for test
COPY_TESTFILES_TO_TESTDIR
# Run the test
+arg="h5repack_layout.h5 -v -f UD=260,4,9,1,8,18"
+TOOLTEST_DUMP plugin_version_test $arg
+
arg="h5repack_layout.h5 -v -f UD=257,1,9"
-TOOLTEST_DUMP plugin_test $arg
+TOOLTEST_DUMP plugin_test $arg
#arg="h5repack_layout.UD.h5 -v -f NONE"
-#TOOLTEST_DUMP plugin_none $arg
+#TOOLTEST_DUMP plugin_none $arg
# print results
if test $nerrors -ne 0 ; then
diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
new file mode 100644
index 0000000..9f69270
--- /dev/null
+++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
@@ -0,0 +1,158 @@
+HDF5 "out-plugin_version_test.h5repack_layout.h5" {
+GROUP "/" {
+ DATASET "dset1" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset2" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset3" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset4" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset_chunk" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, H5S_UNLIMITED ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 20, 10 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset_compact" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+ DATASET "dset_contiguous" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
+ STORAGE_LAYOUT {
+ CHUNKED ( 40, 20 )
+ SIZE 3200 (1.000:1 COMPRESSION)
+ }
+ FILTERS {
+ USER_DEFINED_FILTER {
+ FILTER_ID 260
+ COMMENT dynlib4
+ PARAMS { 9 1 8 18 }
+ }
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_INCR
+ }
+ }
+}
+}
diff --git a/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst b/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst
new file mode 100644
index 0000000..1a496c6
--- /dev/null
+++ b/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst
@@ -0,0 +1,14 @@
+Objects to modify layout are...
+Objects to apply filter are...
+ User Defined 260
+-----------------------------------------
+ Type Filter (Compression) Name
+-----------------------------------------
+ group /
+ dset UD (1.000:1) /dset1
+ dset UD (1.000:1) /dset2
+ dset UD (1.000:1) /dset3
+ dset UD (1.000:1) /dset4
+ dset UD (1.000:1) /dset_chunk
+ dset UD (1.000:1) /dset_compact
+ dset UD (1.000:1) /dset_contiguous