aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-03 16:35:24 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-03 16:35:24 +0200
commit5c1f2aa8a7ca4fb95aa7a75ff810fbee711d1d04 (patch)
tree9a8c3faebd30d00c4449ddb845fe8c26f04375cb /src/namestore/test_common.c
parentd09a97a4891f4ccc764fe36654b4a651926f7c3f (diff)
parent4be1619e0826b061993257aea488f1f14ea888ae (diff)
downloadgnunet-5c1f2aa8a7ca4fb95aa7a75ff810fbee711d1d04.tar.gz
gnunet-5c1f2aa8a7ca4fb95aa7a75ff810fbee711d1d04.zip
Merge branch 'master' of git+ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/namestore/test_common.c')
-rw-r--r--src/namestore/test_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/namestore/test_common.c b/src/namestore/test_common.c
index 58afb0a32..24a88c180 100644
--- a/src/namestore/test_common.c
+++ b/src/namestore/test_common.c
@@ -21,6 +21,7 @@
21 * @file namestore/test_common.c 21 * @file namestore/test_common.c
22 * @brief common functions for testcase setup 22 * @brief common functions for testcase setup
23 */ 23 */
24#include <gnunet_namestore_plugin.h>
24 25
25/** 26/**
26 * test if we can load the plugin @a name. 27 * test if we can load the plugin @a name.
@@ -30,6 +31,7 @@ TNC_test_plugin (const char *cfg_name)
30{ 31{
31 char *database; 32 char *database;
32 char *db_lib_name; 33 char *db_lib_name;
34 char *emsg;
33 struct GNUNET_NAMESTORE_PluginFunctions *db; 35 struct GNUNET_NAMESTORE_PluginFunctions *db;
34 struct GNUNET_CONFIGURATION_Handle *cfg; 36 struct GNUNET_CONFIGURATION_Handle *cfg;
35 37
@@ -53,7 +55,15 @@ TNC_test_plugin (const char *cfg_name)
53 GNUNET_free (database); 55 GNUNET_free (database);
54 db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg); 56 db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg);
55 if (NULL != db) 57 if (NULL != db)
58 {
59 if (GNUNET_OK != db->reset_database (db->cls, &emsg))
60 {
61 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error resetting database: %s\n", emsg);
62 GNUNET_free (emsg);
63 return GNUNET_SYSERR;
64 }
56 GNUNET_break (NULL == GNUNET_PLUGIN_unload (db_lib_name, db)); 65 GNUNET_break (NULL == GNUNET_PLUGIN_unload (db_lib_name, db));
66 }
57 GNUNET_free (db_lib_name); 67 GNUNET_free (db_lib_name);
58 GNUNET_CONFIGURATION_destroy (cfg); 68 GNUNET_CONFIGURATION_destroy (cfg);
59 if (NULL == db) 69 if (NULL == db)