summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2018-12-31 16:28:25 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2018-12-31 16:28:25 (GMT)
commitfba448b1453809f8bc7bad2f5c52495191f7fbdf (patch)
tree8d15920451b419f9adfdee0dd82865d01f1e9ef5
parent905c3ca3d7736b151ff0889290c0c9e377988f26 (diff)
parent3ca19cca5395d79be69209f8d7d0a2b06834a648 (diff)
downloadhdf5-fba448b1453809f8bc7bad2f5c52495191f7fbdf.zip
hdf5-fba448b1453809f8bc7bad2f5c52495191f7fbdf.tar.gz
hdf5-fba448b1453809f8bc7bad2f5c52495191f7fbdf.tar.bz2
Merge pull request #1413 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:yay_plugins to develop
* commit '3ca19cca5395d79be69209f8d7d0a2b06834a648': Flipped swapped testing strings. Added test_vol_plugin.sh to the list of scripts to clean Fixed a CMake build issue (CMake still doesn't run the VOL plugin tests) Added more sub-tests to the VOL plugin test. Added a simple test for registration of VOL connector plugins. Autotools only for right now, but this will be fleshed out in future work.
-rw-r--r--MANIFEST15
-rw-r--r--configure.ac1
-rw-r--r--src/H5VL.c11
-rw-r--r--src/H5VLint.c2
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/Makefile.am19
-rw-r--r--test/null_vol_connector.c (renamed from test/echo_vol.c)33
-rw-r--r--test/null_vol_connector.h25
-rw-r--r--test/test_vol_plugin.sh.in84
-rw-r--r--test/vol_plugin.c291
10 files changed, 437 insertions, 46 deletions
diff --git a/MANIFEST b/MANIFEST
index 8783d84..02c0e1c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -974,7 +974,6 @@
./test/dtypes.c
./test/dtransform.c
./test/earray.c
-./test/echo_vol.c
./test/efc.c
./test/enc_dec_plist.c
./test/enc_dec_plist_cross_platform.c
@@ -1022,6 +1021,7 @@
./test/gen_deflate.c
./test/gen_file_image.c
./test/gen_filespace.c
+./test/gen_filters.c
./test/gen_mergemsg.c
./test/gen_new_array.c
./test/gen_new_fill.c
@@ -1065,6 +1065,8 @@
./test/noencoder.h5
./test/none.h5
./test/ntypes.c
+./test/null_vol_connector.c
+./test/null_vol_connector.h
./test/ohdr.c
./test/objcopy.c
./test/page_buffer.c
@@ -1105,12 +1107,15 @@
./test/testlinks_env.sh.in
./test/test_filenotclosed.sh.in
./test/test_filter_plugin.sh.in
+./test/test_filters_le.h5
+./test/test_filters_be.h5
./test/testflushrefresh.sh.in
./test/testframe.c
./test/testhdf5.c
./test/testhdf5.h
./test/testlibinfo.sh.in
./test/test_usecases.sh.in
+./test/test_vol_plugin.sh.in
./test/testmeta.c
./test/testswmr.sh.in
./test/testvdsswmr.sh.in
@@ -1152,16 +1157,14 @@
./test/use_common.c
./test/use_disable_mdc_flushes.c
./test/use.h
-./test/vfd.c
-./test/vol.c
-./test/test_filters_le.h5
-./test/test_filters_be.h5
-./test/gen_filters.c
./test/vds.c
./test/vds_swmr.h
./test/vds_swmr_gen.c
./test/vds_swmr_reader.c
./test/vds_swmr_writer.c
+./test/vfd.c
+./test/vol.c
+./test/vol_plugin.c
./test/testfiles/err_compat_1
./test/testfiles/err_compat_2
diff --git a/configure.ac b/configure.ac
index b761042..7d9c0c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3409,6 +3409,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
test/test_filenotclosed.sh
test/test_filter_plugin.sh
test/test_usecases.sh
+ test/test_vol_plugin.sh
testpar/Makefile
tools/Makefile
tools/lib/Makefile
diff --git a/src/H5VL.c b/src/H5VL.c
index bf1201f..88d3d70 100644
--- a/src/H5VL.c
+++ b/src/H5VL.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Purpose: The Virtual Object Layer as described in documentation.
+ * Purpose: The Virtual Object Layer as described in documentation.
* The pupose is to provide an abstraction on how to access the
* underlying HDF5 container, whether in a local file with
* a specific file format, or remotely on other machines, etc...
@@ -486,14 +486,11 @@ done:
/*---------------------------------------------------------------------------
* Function: H5VLcmp_connector_cls
*
- * Purpose: Compares two connector classes
+ * Purpose: Compares two connector classes (based on their value field)
*
- * Return: Success: Non-negative, with *cmp set to positive if
- * connector_id1 is greater than connector_id2, negative if connector_id2
- * is greater than connector_id1 and zero if connector_id1 and connector_id2
- * are equal.
+ * Return: Success: Non-negative, *cmp set to a value like strcmp
*
- * Failure: Negative
+ * Failure: Negative, *cmp unset
*
*---------------------------------------------------------------------------
*/
diff --git a/src/H5VLint.c b/src/H5VLint.c
index d51be0c..8695a80 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -881,7 +881,7 @@ done:
*
* Return: Positive if VALUE1 is greater than VALUE2, negative if
* VALUE2 is greater than VALUE1 and zero if VALUE1 and
- * VALUE2 are equal.
+ * VALUE2 are equal (like strcmp).
*
*-------------------------------------------------------------------------
*/
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ed6bacc..69afb85 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -133,7 +133,7 @@ if (BUILD_SHARED_LIBS)
# Define VOL Plugin Test Sources
#-----------------------------------------------------------------------------
set (VOL_PLUGIN_LIBS
- echo_vol
+ null_vol_connector
)
foreach (vol_lib ${VOL_PLUGIN_LIBS})
diff --git a/test/Makefile.am b/test/Makefile.am
index 8ed10a4..1a232ab 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -41,8 +41,8 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) filen
swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \
vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
if HAVE_SHARED_CONDITIONAL
- TEST_SCRIPT += test_filter_plugin.sh
- SCRIPT_DEPEND += filter_plugin$(EXEEXT)
+ TEST_SCRIPT += test_filter_plugin.sh test_vol_plugin.sh
+ SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT)
endif
check_SCRIPTS = $(TEST_SCRIPT)
@@ -83,7 +83,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \
swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer
if HAVE_SHARED_CONDITIONAL
- check_PROGRAMS+= filter_plugin
+ check_PROGRAMS+= filter_plugin vol_plugin
endif
# These programs generate test files for the tests. They don't need to be
@@ -106,9 +106,7 @@ if HAVE_SHARED_CONDITIONAL
# The libh5test library provides common support code for the tests.
# The filter_plugin* libraries are for use in filter_plugin.c.
# Build them as shared libraries if that option was enabled in configure.
- #
- # echo_vol is used for testing VOL plugin functionality.
- noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la echo_vol.la
+ noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la libnull_vol_connector.la
libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c
libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c
libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c
@@ -121,8 +119,10 @@ if HAVE_SHARED_CONDITIONAL
libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
# VOL plugin test libraries
- echo_vol_la_SOURCES=echo_vol.c
- echo_vol_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ #
+ # null_vol_connector is used for testing basic VOL plugin functionality.
+ libnull_vol_connector_la_SOURCES=null_vol_connector.c
+ libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
else
# The libh5test library provides common support code for the tests.
@@ -221,6 +221,7 @@ use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c
# Temporary files.
DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \
- testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh
+ testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh \
+ test_vol_plugin.sh
include $(top_srcdir)/config/conclude.am
diff --git a/test/echo_vol.c b/test/null_vol_connector.c
index 7f59832..b62b370 100644
--- a/test/echo_vol.c
+++ b/test/null_vol_connector.c
@@ -10,19 +10,20 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Purpose: A simple virtual object layer (VOL) plugin that just echoes
- * the name of the API call.
+/* Purpose: A simple virtual object layer (VOL) connector with almost no
+ * functionality that is used for testing basic plugin handling
+ * (registration, etc.).
*/
#include "H5PLextern.h"
-/* The VOL class struct.
- */
-static const H5VL_class_t echo_vol_g = {
+#include "null_vol_connector.h"
+
+/* The VOL class struct */
+static const H5VL_class_t null_vol_g = {
0, /* version */
- (H5VL_class_value_t)501, /* value */
- "echo", /* name */
+ NULL_VOL_CONNECTOR_VALUE, /* value */
+ NULL_VOL_CONNECTOR_NAME, /* name */
0, /* capability flags */
NULL, /* initialize */
NULL, /* terminate */
@@ -106,22 +107,10 @@ static const H5VL_class_t echo_vol_g = {
NULL /* optional */
};
-
-
/* These two functions are necessary to load this plugin using
* the HDF5 library.
*/
-H5PL_type_t
-H5PLget_plugin_type(void)
-{
- return H5PL_TYPE_VOL;
-}
-
-
-const void*
-H5PLget_plugin_info(void)
-{
- return &echo_vol_g;
-}
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_VOL;}
+const void *H5PLget_plugin_info(void) {return &null_vol_g;}
diff --git a/test/null_vol_connector.h b/test/null_vol_connector.h
new file mode 100644
index 0000000..11c8826
--- /dev/null
+++ b/test/null_vol_connector.h
@@ -0,0 +1,25 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Purpose: A simple virtual object layer (VOL) connector with almost no
+ * functionality that is used for testing basic plugin handling
+ * (registration, etc.).
+ */
+
+#ifndef _null_vol_connector_H
+#define _null_vol_connector_H
+
+#define NULL_VOL_CONNECTOR_VALUE ((H5VL_class_value_t)160)
+#define NULL_VOL_CONNECTOR_NAME "null_vol_connector"
+
+#endif /* _null_vol_connector_H */
+
diff --git a/test/test_vol_plugin.sh.in b/test/test_vol_plugin.sh.in
new file mode 100644
index 0000000..38220ef
--- /dev/null
+++ b/test/test_vol_plugin.sh.in
@@ -0,0 +1,84 @@
+#! /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 COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# This shell script is for testing VOL connector plugins.
+#
+srcdir=@srcdir@
+TOP_BUILDDIR=@top_builddir@
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+nerrors=0
+verbose=yes
+exit_code=$EXIT_SUCCESS
+
+TEST_NAME=vol_plugin
+TEST_BIN=`pwd`/$TEST_NAME
+FROM_DIR=`pwd`/.libs
+case $(uname) in
+ CYGWIN* )
+ NULL_VOL_PLUGIN="$FROM_DIR/cygnull_vol_connector*"
+ ;;
+ *)
+ NULL_VOL_PLUGIN="$FROM_DIR/libnull_vol_connector*"
+ ;;
+esac
+TEMP_PLUGIN_DIR=null_vol_plugin_dir
+CP="cp -p" # Use -p to preserve mode,ownership, timestamps
+RM="rm -rf"
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+TESTING() {
+ SPACES=" "
+ echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Main Body
+# Create test directory if necessary.
+test -d $TEMP_PLUGIN_DIR || mkdir -p $TEMP_PLUGIN_DIR
+if [ $? != 0 ]; then
+ echo "Failed to create VOL connector plugin test directory ($TEMP_PLUGIN_DIR)"
+ exit $EXIT_FAILURE
+fi
+
+# Copy plugin for the tests.
+$CP $NULL_VOL_PLUGIN $TEMP_PLUGIN_DIR
+if [ $? != 0 ]; then
+ echo "Failed to copy NULL VOL plugin ($NULL_VOL_PLUGIN) to test directory."
+ exit $EXIT_FAILURE
+fi
+
+# setup plugin path
+ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}"
+
+# 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 VOL plugin tests passed."
+ exit_code=$EXIT_SUCCESS
+fi
+
+# Clean up temporary files/directories and leave
+$RM $TEMP_PLUGIN_DIR
+
+exit $exit_code
diff --git a/test/vol_plugin.c b/test/vol_plugin.c
new file mode 100644
index 0000000..236a67e
--- /dev/null
+++ b/test/vol_plugin.c
@@ -0,0 +1,291 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests basic VOL plugin operations (registration, etc.).
+ * Uses the null VOL connector (built with the testing code)
+ * which is loaded as a dynamic plugin.
+ *
+ * TO DO: Adapt the null VOL connector to do something interesting with
+ * the property list.
+ */
+
+#include "h5test.h"
+
+#include "null_vol_connector.h"
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_registration_by_value()
+ *
+ * Purpose: Tests if we can load, register, and close a VOL
+ * connector by value.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_registration_by_value(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+
+ TESTING("VOL registration by value");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by value */
+ if((vol_id = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_registration_by_value() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_registration_by_name()
+ *
+ * Purpose: Tests if we can load, register, and close a VOL
+ * connector by name.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_registration_by_name(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+
+ TESTING("VOL registration by name");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by name */
+ if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_registration_by_name() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_multiple_registration()
+ *
+ * Purpose: Tests if we can register a VOL connector multiple times.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+#define N_REGISTRATIONS 10
+static herr_t
+test_multiple_registration(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_ids[N_REGISTRATIONS];
+ int i;
+
+ TESTING("registering a VOL connector multiple times");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector multiple times */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if((vol_ids[i] = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if(H5VLunregister_connector(vol_ids[i]) < 0)
+ TEST_ERROR;
+ /* Also test close on some of the IDs. This call currently works
+ * identically to unregister.
+ */
+ i++;
+ if(H5VLclose(vol_ids[i]) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < N_REGISTRATIONS; i++)
+ H5VLunregister_connector(vol_ids[i]);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_multiple_registration() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_getters()
+ *
+ * Purpose: Tests H5VL getters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_getters(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+ hid_t vol_id_out = H5I_INVALID_HID;
+
+ TESTING("VOL getters");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by name */
+ if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Get the connector's ID */
+ if((vol_id_out = H5VLget_connector_id(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(vol_id != vol_id_out)
+ FAIL_PUTS_ERROR("VOL connector IDs don't match");
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_getters() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests VOL connector plugin operations
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ h5_reset();
+
+ HDputs("Testing VOL connector plugin functionality.");
+
+ nerrors += test_registration_by_name() < 0 ? 1 : 0;
+ nerrors += test_registration_by_value() < 0 ? 1 : 0;
+ nerrors += test_multiple_registration() < 0 ? 1 : 0;
+ nerrors += test_getters() < 0 ? 1 : 0;
+
+ if(nerrors) {
+ HDprintf("***** %d VOL connector plugin TEST%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+ HDexit(EXIT_FAILURE);
+ }
+
+ HDputs("All VOL connector plugin tests passed.");
+
+ HDexit(EXIT_SUCCESS);
+
+} /* end main() */
+