diff options
Diffstat (limited to 'src/namestore/test_common.c')
-rw-r--r-- | src/namestore/test_common.c | 10 |
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) |