[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: -rename plugin, otherwise plugin_test fa
From: |
gnunet |
Subject: |
[gnunet] branch master updated: -rename plugin, otherwise plugin_test fails due to conflicting other plugin with the same prefix name |
Date: |
Fri, 30 Jul 2021 12:28:27 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new e84ea6f9f -rename plugin, otherwise plugin_test fails due to
conflicting other plugin with the same prefix name
e84ea6f9f is described below
commit e84ea6f9f1718298486a088832c87479bd6e9572
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jul 30 12:25:07 2021 +0200
-rename plugin, otherwise plugin_test fails due to conflicting other plugin
with the same prefix name
---
src/util/Makefile.am | 6 +++---
src/util/plugin.c | 6 +++++-
src/util/test_plugin.c | 52 ++++++++++++++++++++++++++++++---------------
src/util/test_plugin_plug.c | 5 +++--
4 files changed, 46 insertions(+), 23 deletions(-)
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 37eb0508b..89d040a0c 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -242,11 +242,11 @@ gnunet_qr_LDADD = \
gnunet_qr_LDFLAGS= -lzbar
plugin_LTLIBRARIES = \
- libgnunet_plugin_test.la
+ libgnunet_plugin_utiltest.la
-libgnunet_plugin_test_la_SOURCES = \
+libgnunet_plugin_utiltest_la_SOURCES = \
test_plugin_plug.c
-libgnunet_plugin_test_la_LDFLAGS = \
+libgnunet_plugin_utiltest_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
if HAVE_BENCHMARKS
diff --git a/src/util/plugin.c b/src/util/plugin.c
index feb661f24..39874a588 100644
--- a/src/util/plugin.c
+++ b/src/util/plugin.c
@@ -447,8 +447,12 @@ GNUNET_PLUGIN_load_all_in_context (const struct
GNUNET_OS_ProjectData *ctx,
void *cb_cls)
{
const struct GNUNET_OS_ProjectData *cpd = GNUNET_OS_project_data_get ();
+
GNUNET_OS_init (ctx);
- GNUNET_PLUGIN_load_all (basename, arg, cb, cb_cls);
+ GNUNET_PLUGIN_load_all (basename,
+ arg,
+ cb,
+ cb_cls);
GNUNET_OS_init (cpd);
}
diff --git a/src/util/test_plugin.c b/src/util/test_plugin.c
index c0eb717d6..e739d17c9 100644
--- a/src/util/test_plugin.c
+++ b/src/util/test_plugin.c
@@ -26,15 +26,22 @@
static void
-test_cb (void *cls, const char *libname, void *lib_ret)
+test_cb (void *cls,
+ const char *libname,
+ void *lib_ret)
{
- void *ret;
+ const char *test_cls = cls;
+ char *ret;
- GNUNET_assert (0 == strcmp (cls, "test"));
- GNUNET_assert (0 == strcmp (lib_ret, "Hello"));
- ret = GNUNET_PLUGIN_unload (libname, "out");
+ GNUNET_assert (0 == strcmp (test_cls,
+ "test-closure"));
+ GNUNET_assert (0 == strcmp (lib_ret,
+ "Hello"));
+ ret = GNUNET_PLUGIN_unload (libname,
+ "out");
GNUNET_assert (NULL != ret);
- GNUNET_assert (0 == strcmp (ret, "World"));
+ GNUNET_assert (0 == strcmp (ret,
+ "World"));
free (ret);
}
@@ -44,24 +51,35 @@ main (int argc, char *argv[])
{
void *ret;
- GNUNET_log_setup ("test-plugin", "WARNING", NULL);
- GNUNET_log_skip (1, GNUNET_NO);
- ret = GNUNET_PLUGIN_load ("libgnunet_plugin_missing", NULL);
+ GNUNET_log_setup ("test-plugin",
+ "WARNING",
+ NULL);
+ GNUNET_log_skip (1,
+ GNUNET_NO);
+ ret = GNUNET_PLUGIN_load ("libgnunet_plugin_missing",
+ NULL);
GNUNET_log_skip (0, GNUNET_NO);
- if (ret != NULL)
+ if (NULL != ret)
return 1;
- ret = GNUNET_PLUGIN_load ("libgnunet_plugin_test", "in");
- if (ret == NULL)
+ ret = GNUNET_PLUGIN_load ("libgnunet_plugin_utiltest",
+ "in");
+ if (NULL == ret)
return 1;
- if (0 != strcmp (ret, "Hello"))
+ if (0 != strcmp (ret,
+ "Hello"))
return 2;
- ret = GNUNET_PLUGIN_unload ("libgnunet_plugin_test", "out");
- if (ret == NULL)
+ ret = GNUNET_PLUGIN_unload ("libgnunet_plugin_utiltest",
+ "out");
+ if (NULL == ret)
return 3;
- if (0 != strcmp (ret, "World"))
+ if (0 != strcmp (ret,
+ "World"))
return 4;
free (ret);
- GNUNET_PLUGIN_load_all ("libgnunet_plugin_tes", "in", &test_cb, "test");
+ GNUNET_PLUGIN_load_all ("libgnunet_plugin_utiltes",
+ "in",
+ &test_cb,
+ "test-closure");
return 0;
}
diff --git a/src/util/test_plugin_plug.c b/src/util/test_plugin_plug.c
index 39c8774b1..bfaad52e8 100644
--- a/src/util/test_plugin_plug.c
+++ b/src/util/test_plugin_plug.c
@@ -23,8 +23,9 @@
*/
#include "platform.h"
+
void *
-libgnunet_plugin_test_init (void *arg)
+libgnunet_plugin_utiltest_init (void *arg)
{
if (0 == strcmp (arg, "in"))
return "Hello";
@@ -33,7 +34,7 @@ libgnunet_plugin_test_init (void *arg)
void *
-libgnunet_plugin_test_done (void *arg)
+libgnunet_plugin_utiltest_done (void *arg)
{
if (0 == strcmp (arg, "out"))
return strdup ("World");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: -rename plugin, otherwise plugin_test fails due to conflicting other plugin with the same prefix name,
gnunet <=