From a8a0a4e8cfec84d354a46bff2c5b76ca5b02c314 Mon Sep 17 00:00:00 2001 From: JeroMiya Date: Wed, 13 Apr 2016 18:24:11 -0400 Subject: [PATCH 01/11] Modification to the LoadPlugin code for libdl to check if the entry point symbol is already pre-loaded. --- src/libfunctionality/LoadPluginLibdl.h | 61 +++++++++++++++++--------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/src/libfunctionality/LoadPluginLibdl.h b/src/libfunctionality/LoadPluginLibdl.h index 40fae60..ae3ad2b 100644 --- a/src/libfunctionality/LoadPluginLibdl.h +++ b/src/libfunctionality/LoadPluginLibdl.h @@ -50,6 +50,26 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { throw exceptions::BadPluginName(); } + typedef void *(*DlsymReturn)(); + + // attempt to load the symbol from the global symbol table. If successful, + // plugin is already pre-loaded + { + std::string ep_name = std::string("libfunc_ep_") + n; + DlsymReturn raw_ep; + *(void **)(&raw_ep) = + dlsym(0, ep_name.c_str()); + + if (dlerror() == NULL && raw_ep != NULL) { + entry_point_t ep = reinterpret_cast(raw_ep); + libfunc_ep_return_t result = (*ep)(opaque); + if (result != LIBFUNC_RETURN_SUCCESS) { + throw exceptions::PluginEntryPointFailed(n); + } + return PluginHandle(); + } + } + LibraryHandle lib(RAIILoadLibrary(n + LIBFUNC_MODULE_SUFFIX)); if (!lib) { @@ -65,27 +85,28 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { /// Posix-recommended, /// the other is simpler C++. #if 1 - typedef void *(*DlsymReturn)(); - DlsymReturn raw_ep; - *(void **)(&raw_ep) = - dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); - if (dlerror() != NULL || raw_ep == NULL) { - throw exceptions::CannotLoadEntryPoint(n); + { + DlsymReturn raw_ep; + *(void **)(&raw_ep) = + dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); + if (dlerror() != NULL || raw_ep == NULL) { + throw exceptions::CannotLoadEntryPoint(n); + } + entry_point_t ep = reinterpret_cast(raw_ep); + #else + entry_point_t ep = reinterpret_cast( + dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING)); + #endif + + if (dlerror() != NULL || ep == NULL) { + throw exceptions::CannotLoadEntryPoint(n); + } + libfunc_ep_return_t result = (*ep)(opaque); + if (result != LIBFUNC_RETURN_SUCCESS) { + throw exceptions::PluginEntryPointFailed(n); + } } - entry_point_t ep = reinterpret_cast(raw_ep); -#else - entry_point_t ep = reinterpret_cast( - dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING)); -#endif - - if (dlerror() != NULL || ep == NULL) { - throw exceptions::CannotLoadEntryPoint(n); - } - libfunc_ep_return_t result = (*ep)(opaque); - if (result != LIBFUNC_RETURN_SUCCESS) { - throw exceptions::PluginEntryPointFailed(n); - } - + return PluginHandle(lib); } } // end of namespace libfunc From 4ec14ea1489af6148526d049bc1461724e102a1d Mon Sep 17 00:00:00 2001 From: JeroMiya Date: Fri, 15 Apr 2016 12:09:59 -0400 Subject: [PATCH 02/11] Updated LIBFUNC_DETAIL_PLUGIN to export the unique entry point symbol with LIBFUNC_DETAIL_EP_DECORATION. Also updated LoadPluginLibdl.h to use dlsym(RTLD_DEFAULT, ...) in its attempt to check if the symbol is loaded into the global symbol table. This makes it now work on Android. --- inc/libfunctionality/PluginInterface.h | 2 +- src/libfunctionality/LoadPluginLibdl.h | 33 +++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/inc/libfunctionality/PluginInterface.h b/inc/libfunctionality/PluginInterface.h index 840cfae..b04ee17 100644 --- a/inc/libfunctionality/PluginInterface.h +++ b/inc/libfunctionality/PluginInterface.h @@ -59,7 +59,7 @@ Copyright 2014 Sensics, Inc. * In dynamic mode, we have to create the common entry point as a trampoline to * the unique one. */ #define LIBFUNC_DETAIL_PLUGIN(PLUGINNAME) \ - LIBFUNC_DETAIL_EP_DECLARATION(PLUGINNAME); \ + LIBFUNC_DETAIL_EP_DECORATION LIBFUNC_DETAIL_EP_DECLARATION(PLUGINNAME); \ LIBFUNC_DETAIL_EP_DECORATION LIBFUNC_DETAIL_EP_COMMON_DECLARATION { \ return LIBFUNC_DETAIL_EP_NAME(PLUGINNAME)(LIBFUNC_DETAIL_PARAM_NAME); \ } diff --git a/src/libfunctionality/LoadPluginLibdl.h b/src/libfunctionality/LoadPluginLibdl.h index ae3ad2b..b0a9d97 100644 --- a/src/libfunctionality/LoadPluginLibdl.h +++ b/src/libfunctionality/LoadPluginLibdl.h @@ -57,19 +57,20 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { { std::string ep_name = std::string("libfunc_ep_") + n; DlsymReturn raw_ep; - *(void **)(&raw_ep) = - dlsym(0, ep_name.c_str()); - - if (dlerror() == NULL && raw_ep != NULL) { - entry_point_t ep = reinterpret_cast(raw_ep); - libfunc_ep_return_t result = (*ep)(opaque); - if (result != LIBFUNC_RETURN_SUCCESS) { - throw exceptions::PluginEntryPointFailed(n); - } - return PluginHandle(); - } + dlerror(); // clear the error + *(void **)(&raw_ep) = dlsym(RTLD_DEFAULT, ep_name.c_str()); + + const char* err = dlerror(); + if (err == NULL && raw_ep != NULL) { + entry_point_t ep = reinterpret_cast(raw_ep); + libfunc_ep_return_t result = (*ep)(opaque); + if (result != LIBFUNC_RETURN_SUCCESS) { + throw exceptions::PluginEntryPointFailed(n); + } + return PluginHandle(); + } } - + LibraryHandle lib(RAIILoadLibrary(n + LIBFUNC_MODULE_SUFFIX)); if (!lib) { @@ -84,8 +85,8 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { /// @todo Pick one of these two implementations - one is more C and /// Posix-recommended, /// the other is simpler C++. -#if 1 { +#if 1 DlsymReturn raw_ep; *(void **)(&raw_ep) = dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); @@ -93,10 +94,10 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { throw exceptions::CannotLoadEntryPoint(n); } entry_point_t ep = reinterpret_cast(raw_ep); - #else +#else entry_point_t ep = reinterpret_cast( dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING)); - #endif +#endif if (dlerror() != NULL || ep == NULL) { throw exceptions::CannotLoadEntryPoint(n); @@ -106,7 +107,7 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { throw exceptions::PluginEntryPointFailed(n); } } - + return PluginHandle(lib); } } // end of namespace libfunc From 332d3cebf3a6220b18b56f654a25a7debb38100f Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 22 Apr 2016 18:19:38 -0500 Subject: [PATCH 03/11] Define a separate macro for the prefix of unique entry point names. --- inc/libfunctionality/Common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/libfunctionality/Common.h b/inc/libfunctionality/Common.h index b2f85d0..0cf2f46 100644 --- a/inc/libfunctionality/Common.h +++ b/inc/libfunctionality/Common.h @@ -64,9 +64,13 @@ Copyright 2014 Sensics, Inc. /** @brief Utility macro for token pasting aka concatenation */ #define LIBFUNC_DETAIL_CAT(A, B) LIBFUNC_DETAIL_CAT_IMPL(A##B) +/** @brief The prefix appended to a plugin name to generate a unique entry point + * name. */ +#define LIBFUNC_DETAIL_EP_PREFIX libfunc_ep_ + /** @brief Generate the unique entry point name for each plugin. */ #define LIBFUNC_DETAIL_EP_NAME(PLUGINNAME) \ - LIBFUNC_DETAIL_CAT(libfunc_ep_, PLUGINNAME) + LIBFUNC_DETAIL_CAT(LIBFUNC_DETAIL_EP_PREFIX, PLUGINNAME) /** @brief Return type of the entry point function. */ typedef char libfunc_ep_return_t; From 3021c47b948dc2d9a53eb789ecde751c57af1208 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 22 Apr 2016 18:22:55 -0500 Subject: [PATCH 04/11] Add a stringify macro and use it to avoid duplicating the prefix. --- inc/libfunctionality/Common.h | 6 ++++++ src/libfunctionality/LoadPluginLibdl.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/libfunctionality/Common.h b/inc/libfunctionality/Common.h index 0cf2f46..2e6315d 100644 --- a/inc/libfunctionality/Common.h +++ b/inc/libfunctionality/Common.h @@ -64,6 +64,12 @@ Copyright 2014 Sensics, Inc. /** @brief Utility macro for token pasting aka concatenation */ #define LIBFUNC_DETAIL_CAT(A, B) LIBFUNC_DETAIL_CAT_IMPL(A##B) +/** @brief Utility macro used in stringification of macros. */ +#define LIBFUNC_DETAIL_STRINGIFY_IMPL(X) #X + +/** @brief Utility macro forstringification of macro expansions. */ +#define LIBFUNC_DETAIL_STRINGIFY(X) LIBFUNC_DETAIL_STRINGIFY_IMPL(X) + /** @brief The prefix appended to a plugin name to generate a unique entry point * name. */ #define LIBFUNC_DETAIL_EP_PREFIX libfunc_ep_ diff --git a/src/libfunctionality/LoadPluginLibdl.h b/src/libfunctionality/LoadPluginLibdl.h index b0a9d97..1d2f5e5 100644 --- a/src/libfunctionality/LoadPluginLibdl.h +++ b/src/libfunctionality/LoadPluginLibdl.h @@ -55,7 +55,8 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { // attempt to load the symbol from the global symbol table. If successful, // plugin is already pre-loaded { - std::string ep_name = std::string("libfunc_ep_") + n; + std::string ep_name = + std::string(LIBFUNC_DETAIL_STRINGIFY(LIBFUNC_DETAIL_EP_PREFIX)) + n; DlsymReturn raw_ep; dlerror(); // clear the error *(void **)(&raw_ep) = dlsym(RTLD_DEFAULT, ep_name.c_str()); From 21bfe07a87cdb814a576d3a2113b9687b0b5ca21 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 22 Apr 2016 18:24:32 -0500 Subject: [PATCH 05/11] Factor out the conversion and calling of a retrieved entry point. --- src/libfunctionality/LoadPluginLibdl.h | 45 +++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/libfunctionality/LoadPluginLibdl.h b/src/libfunctionality/LoadPluginLibdl.h index 1d2f5e5..bfce6b0 100644 --- a/src/libfunctionality/LoadPluginLibdl.h +++ b/src/libfunctionality/LoadPluginLibdl.h @@ -45,13 +45,29 @@ PluginHandle loadPluginByName(const char *n, void *opaque) { return loadPluginByName(std::string(n), opaque); } +typedef void *(*DlsymReturn)(); + +/// internal helper function used by both the global symbol table entry point +/// path as well as the load from the dlopened handle path +static inline entry_point_t convertAndCallEntryPoint(std::string const &n, + DlsymReturn raw_ep, + void *opaque) { + entry_point_t ep = reinterpret_cast(raw_ep); + if (ep == NULL) { + throw exceptions::CannotLoadEntryPoint(n); + } + libfunc_ep_return_t result = (*ep)(opaque); + if (result != LIBFUNC_RETURN_SUCCESS) { + throw exceptions::PluginEntryPointFailed(n); + } + return ep; +} + PluginHandle loadPluginByName(std::string const &n, void *opaque) { if (n.empty()) { throw exceptions::BadPluginName(); } - typedef void *(*DlsymReturn)(); - // attempt to load the symbol from the global symbol table. If successful, // plugin is already pre-loaded { @@ -61,13 +77,11 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { dlerror(); // clear the error *(void **)(&raw_ep) = dlsym(RTLD_DEFAULT, ep_name.c_str()); - const char* err = dlerror(); + const char *err = dlerror(); if (err == NULL && raw_ep != NULL) { - entry_point_t ep = reinterpret_cast(raw_ep); - libfunc_ep_return_t result = (*ep)(opaque); - if (result != LIBFUNC_RETURN_SUCCESS) { - throw exceptions::PluginEntryPointFailed(n); - } + convertAndCallEntryPoint(n, raw_ep, opaque); + // Yes, returning an empty PluginHandle here works fine, since it's + // just for lifetime management. return PluginHandle(); } } @@ -87,26 +101,13 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { /// Posix-recommended, /// the other is simpler C++. { -#if 1 DlsymReturn raw_ep; *(void **)(&raw_ep) = dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); if (dlerror() != NULL || raw_ep == NULL) { throw exceptions::CannotLoadEntryPoint(n); } - entry_point_t ep = reinterpret_cast(raw_ep); -#else - entry_point_t ep = reinterpret_cast( - dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING)); -#endif - - if (dlerror() != NULL || ep == NULL) { - throw exceptions::CannotLoadEntryPoint(n); - } - libfunc_ep_return_t result = (*ep)(opaque); - if (result != LIBFUNC_RETURN_SUCCESS) { - throw exceptions::PluginEntryPointFailed(n); - } + convertAndCallEntryPoint(n, raw_ep, opaque); } return PluginHandle(lib); From 863e1e8d48d4033eb66d33411b36ed475383a0a8 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 22 Apr 2016 18:25:04 -0500 Subject: [PATCH 06/11] Factor out the retrieval of entry points mostly to not duplicate the gross cast involved. --- src/libfunctionality/LoadPluginLibdl.h | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/libfunctionality/LoadPluginLibdl.h b/src/libfunctionality/LoadPluginLibdl.h index bfce6b0..c6e2be4 100644 --- a/src/libfunctionality/LoadPluginLibdl.h +++ b/src/libfunctionality/LoadPluginLibdl.h @@ -47,6 +47,18 @@ PluginHandle loadPluginByName(const char *n, void *opaque) { typedef void *(*DlsymReturn)(); +/// Mini helper wrapper around dlsym, because that cast is nasty. +static inline DlsymReturn retrieveEntryPoint(void *handle, const char *name) { + DlsymReturn raw_ep; + // Appropriate, but odd, syntax per the dlopen(3) man page. + // and + // http://stackoverflow.com/questions/1354537/dlsym-dlopen-with-runtime-arguments + dlerror(); // clear the error + /// @todo This is more C than C++, but it's Posix-recommended, + *(void **)(&raw_ep) = dlsym(handle, name); + return raw_ep; +} + /// internal helper function used by both the global symbol table entry point /// path as well as the load from the dlopened handle path static inline entry_point_t convertAndCallEntryPoint(std::string const &n, @@ -73,9 +85,7 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { { std::string ep_name = std::string(LIBFUNC_DETAIL_STRINGIFY(LIBFUNC_DETAIL_EP_PREFIX)) + n; - DlsymReturn raw_ep; - dlerror(); // clear the error - *(void **)(&raw_ep) = dlsym(RTLD_DEFAULT, ep_name.c_str()); + DlsymReturn raw_ep = retrieveEntryPoint(RTLD_DEFAULT, ep_name.c_str()); const char *err = dlerror(); if (err == NULL && raw_ep != NULL) { @@ -92,18 +102,9 @@ PluginHandle loadPluginByName(std::string const &n, void *opaque) { throw exceptions::CannotLoadPlugin(n); } - // Appropriate, but odd, syntax per the dlopen(3) man page. - // and - // http://stackoverflow.com/questions/1354537/dlsym-dlopen-with-runtime-arguments - dlerror(); // clear errors - -/// @todo Pick one of these two implementations - one is more C and -/// Posix-recommended, -/// the other is simpler C++. { - DlsymReturn raw_ep; - *(void **)(&raw_ep) = - dlsym(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); + DlsymReturn raw_ep = + retrieveEntryPoint(lib.get(), LIBFUNC_DETAIL_EP_COMMON_NAME_STRING); if (dlerror() != NULL || raw_ep == NULL) { throw exceptions::CannotLoadEntryPoint(n); } From 9bb6fb49f797880904c335b3c53f903b42cf3524 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 22 Apr 2016 18:25:24 -0500 Subject: [PATCH 07/11] Now that we have a working stringify, DRY another place in the header. --- inc/libfunctionality/Common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/libfunctionality/Common.h b/inc/libfunctionality/Common.h index 2e6315d..65fefe1 100644 --- a/inc/libfunctionality/Common.h +++ b/inc/libfunctionality/Common.h @@ -100,7 +100,8 @@ typedef char libfunc_ep_return_t; /** @brief The string name of the common entry point. @todo make this use c preproc stringize while dodging portability problems. */ -#define LIBFUNC_DETAIL_EP_COMMON_NAME_STRING "libfunc_entry_point" +#define LIBFUNC_DETAIL_EP_COMMON_NAME_STRING \ + LIBFUNC_DETAIL_STRINGIFY(LIBFUNC_DETAIL_EP_COMMON_NAME) /** @brief Declaration of the common entry point used in dynamic mode. */ #define LIBFUNC_DETAIL_EP_COMMON_DECLARATION \ From 2f2521353c29224274f238882cc0b62770459dfe Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 26 Apr 2016 13:53:33 -0500 Subject: [PATCH 08/11] Fix comment typo. --- inc/libfunctionality/Common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/libfunctionality/Common.h b/inc/libfunctionality/Common.h index 65fefe1..eef2dac 100644 --- a/inc/libfunctionality/Common.h +++ b/inc/libfunctionality/Common.h @@ -67,7 +67,7 @@ Copyright 2014 Sensics, Inc. /** @brief Utility macro used in stringification of macros. */ #define LIBFUNC_DETAIL_STRINGIFY_IMPL(X) #X -/** @brief Utility macro forstringification of macro expansions. */ +/** @brief Utility macro for stringification of macro expansions. */ #define LIBFUNC_DETAIL_STRINGIFY(X) LIBFUNC_DETAIL_STRINGIFY_IMPL(X) /** @brief The prefix appended to a plugin name to generate a unique entry point From 2497e905639e7ddf03ebf57d75e95f15d901d7d7 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 26 Apr 2016 13:54:55 -0500 Subject: [PATCH 09/11] Second-level expansion required for unique entry point. Needed so we get entry points that look like libfunc_ep_com_sensics_libfunc_tests_dummyplugin (as before/expected) and not like this (with an unexpanded macro in it) LIBFUNC_DETAIL_EP_PREFIXcom_sensics_libfunc_tests_dummyplugin --- inc/libfunctionality/Common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/libfunctionality/Common.h b/inc/libfunctionality/Common.h index eef2dac..aa81ec3 100644 --- a/inc/libfunctionality/Common.h +++ b/inc/libfunctionality/Common.h @@ -74,9 +74,14 @@ Copyright 2014 Sensics, Inc. * name. */ #define LIBFUNC_DETAIL_EP_PREFIX libfunc_ep_ +/** @brief Utility macro (second-level expansion) for unique entry point + * generation */ +#define LIBFUNC_DETAIL_EP_NAME_IMPL(X, PLUGINNAME) \ + LIBFUNC_DETAIL_CAT(X, PLUGINNAME) + /** @brief Generate the unique entry point name for each plugin. */ #define LIBFUNC_DETAIL_EP_NAME(PLUGINNAME) \ - LIBFUNC_DETAIL_CAT(LIBFUNC_DETAIL_EP_PREFIX, PLUGINNAME) + LIBFUNC_DETAIL_EP_NAME_IMPL(LIBFUNC_DETAIL_EP_PREFIX, PLUGINNAME) /** @brief Return type of the entry point function. */ typedef char libfunc_ep_return_t; From e25f3c0f4c0cc09a3f2b14d6aa7da54fe5ad9eae Mon Sep 17 00:00:00 2001 From: JeroMiya Date: Tue, 26 Apr 2016 15:34:56 -0400 Subject: [PATCH 10/11] Added test for static/pre-loaded plugins. --- tests/cplusplus/LoadTest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/cplusplus/LoadTest.cpp b/tests/cplusplus/LoadTest.cpp index 4122cc5..f7255e4 100644 --- a/tests/cplusplus/LoadTest.cpp +++ b/tests/cplusplus/LoadTest.cpp @@ -26,6 +26,7 @@ // Internal Includes #include +#include // Library/third-party includes #include "gtest/gtest.h" @@ -35,6 +36,14 @@ using std::string; +LIBFUNC_PLUGIN_NO_PARAM(com_sensics_libfunc_tests_staticplugin) { + return LIBFUNC_RETURN_SUCCESS; +} + +TEST(load_static_plugin, load_from_global) { + ASSERT_NO_THROW((libfunc::loadPluginByName("com_sensics_libfunc_tests_staticplugin", NULL))); +} + TEST(load_dummy_plugin, cstr_name_null_data) { ASSERT_NO_THROW((libfunc::loadPluginByName("DummyPlugin", NULL))); } From cd623389c454dff1631e982cc00a43c3357b889a Mon Sep 17 00:00:00 2001 From: JeroMiya Date: Tue, 26 Apr 2016 16:41:49 -0400 Subject: [PATCH 11/11] Added guards around the global symbol table plugin loading path, as that is only currently implemented in the libdl path. --- tests/cplusplus/LoadTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cplusplus/LoadTest.cpp b/tests/cplusplus/LoadTest.cpp index f7255e4..0804f2f 100644 --- a/tests/cplusplus/LoadTest.cpp +++ b/tests/cplusplus/LoadTest.cpp @@ -36,6 +36,10 @@ using std::string; +// loading from the global symbol table is only implemented currently in the libdl path +// @todo implement global symbol table plugin loading in the win32 path and remove this ifdef +#ifdef LIBFUNC_DL_LIBDL + LIBFUNC_PLUGIN_NO_PARAM(com_sensics_libfunc_tests_staticplugin) { return LIBFUNC_RETURN_SUCCESS; } @@ -44,6 +48,8 @@ TEST(load_static_plugin, load_from_global) { ASSERT_NO_THROW((libfunc::loadPluginByName("com_sensics_libfunc_tests_staticplugin", NULL))); } +#endif + TEST(load_dummy_plugin, cstr_name_null_data) { ASSERT_NO_THROW((libfunc::loadPluginByName("DummyPlugin", NULL))); }