diff options
Diffstat (limited to 'src/namestore/test_common.c')
-rw-r--r-- | src/namestore/test_common.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/namestore/test_common.c b/src/namestore/test_common.c index d88d1feb9..58afb0a32 100644 --- a/src/namestore/test_common.c +++ b/src/namestore/test_common.c | |||
@@ -26,36 +26,36 @@ | |||
26 | * test if we can load the plugin @a name. | 26 | * test if we can load the plugin @a name. |
27 | */ | 27 | */ |
28 | static int | 28 | static int |
29 | TNC_test_plugin(const char *cfg_name) | 29 | TNC_test_plugin (const char *cfg_name) |
30 | { | 30 | { |
31 | char *database; | 31 | char *database; |
32 | char *db_lib_name; | 32 | char *db_lib_name; |
33 | struct GNUNET_NAMESTORE_PluginFunctions *db; | 33 | struct GNUNET_NAMESTORE_PluginFunctions *db; |
34 | struct GNUNET_CONFIGURATION_Handle *cfg; | 34 | struct GNUNET_CONFIGURATION_Handle *cfg; |
35 | 35 | ||
36 | cfg = GNUNET_CONFIGURATION_create(); | 36 | cfg = GNUNET_CONFIGURATION_create (); |
37 | if (GNUNET_OK != GNUNET_CONFIGURATION_load(cfg, cfg_name)) | 37 | if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfg_name)) |
38 | { | 38 | { |
39 | GNUNET_break(0); | 39 | GNUNET_break (0); |
40 | GNUNET_CONFIGURATION_destroy(cfg); | 40 | GNUNET_CONFIGURATION_destroy (cfg); |
41 | return GNUNET_SYSERR; | 41 | return GNUNET_SYSERR; |
42 | } | 42 | } |
43 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string(cfg, | 43 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, |
44 | "namestore", | 44 | "namestore", |
45 | "database", | 45 | "database", |
46 | &database)) | 46 | &database)) |
47 | { | 47 | { |
48 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "No database backend configured\n"); | 48 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No database backend configured\n"); |
49 | GNUNET_CONFIGURATION_destroy(cfg); | 49 | GNUNET_CONFIGURATION_destroy (cfg); |
50 | return GNUNET_SYSERR; | 50 | return GNUNET_SYSERR; |
51 | } | 51 | } |
52 | GNUNET_asprintf(&db_lib_name, "libgnunet_plugin_namestore_%s", database); | 52 | GNUNET_asprintf (&db_lib_name, "libgnunet_plugin_namestore_%s", database); |
53 | GNUNET_free(database); | 53 | GNUNET_free (database); |
54 | db = GNUNET_PLUGIN_load(db_lib_name, (void *)cfg); | 54 | db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg); |
55 | if (NULL != db) | 55 | if (NULL != db) |
56 | GNUNET_break(NULL == GNUNET_PLUGIN_unload(db_lib_name, db)); | 56 | GNUNET_break (NULL == GNUNET_PLUGIN_unload (db_lib_name, db)); |
57 | GNUNET_free(db_lib_name); | 57 | GNUNET_free (db_lib_name); |
58 | GNUNET_CONFIGURATION_destroy(cfg); | 58 | GNUNET_CONFIGURATION_destroy (cfg); |
59 | if (NULL == db) | 59 | if (NULL == db) |
60 | return GNUNET_NO; | 60 | return GNUNET_NO; |
61 | return GNUNET_YES; | 61 | return GNUNET_YES; |
@@ -68,13 +68,13 @@ TNC_test_plugin(const char *cfg_name) | |||
68 | */ | 68 | */ |
69 | #define SETUP_CFG(plugin_name, cfg_name) \ | 69 | #define SETUP_CFG(plugin_name, cfg_name) \ |
70 | do \ | 70 | do \ |
71 | { \ | 71 | { \ |
72 | plugin_name = GNUNET_TESTING_get_testname_from_underscore(argv[0]); \ | 72 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); \ |
73 | GNUNET_asprintf(&cfg_name, "test_namestore_api_%s.conf", plugin_name); \ | 73 | GNUNET_asprintf (&cfg_name, "test_namestore_api_%s.conf", plugin_name); \ |
74 | if (!TNC_test_plugin(cfg_name)) \ | 74 | if (! TNC_test_plugin (cfg_name)) \ |
75 | { \ | 75 | { \ |
76 | GNUNET_free(cfg_name); \ | 76 | GNUNET_free (cfg_name); \ |
77 | return 77; \ | 77 | return 77; \ |
78 | } \ | 78 | } \ |
79 | GNUNET_DISK_purge_cfg_dir(cfg_name, "GNUNET_TEST_HOME"); \ | 79 | GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME"); \ |
80 | } while (0) | 80 | } while (0) |