diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-26 00:34:16 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-26 00:34:16 +0100 |
commit | eb1c2236158eba266de1bc91d75d9c6d0714252b (patch) | |
tree | 65f0c65a42524fb1529ffa8051a2f7181a813d8f /src/datastore/test_datastore_api_management.c | |
parent | 07f48a8e74b61f518a4b169075cb0a1cb1419166 (diff) | |
download | gnunet-eb1c2236158eba266de1bc91d75d9c6d0714252b.tar.gz gnunet-eb1c2236158eba266de1bc91d75d9c6d0714252b.zip |
fix crash in test if DB did not yet exist
Diffstat (limited to 'src/datastore/test_datastore_api_management.c')
-rw-r--r-- | src/datastore/test_datastore_api_management.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 5e536d6c5..9a3e5446b 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c | |||
@@ -298,7 +298,21 @@ run (void *cls, | |||
298 | 298 | ||
299 | 299 | ||
300 | /** | 300 | /** |
301 | * check if plugin is actually working | 301 | * Function called when disk utilization changes, does nothing. |
302 | * | ||
303 | * @param cls closure | ||
304 | * @param delta change in utilization | ||
305 | */ | ||
306 | static void | ||
307 | ignore_payload_cb (void *cls, | ||
308 | int delta) | ||
309 | { | ||
310 | /* do nothing */ | ||
311 | } | ||
312 | |||
313 | |||
314 | /** | ||
315 | * check if plugin is actually working | ||
302 | */ | 316 | */ |
303 | static int | 317 | static int |
304 | test_plugin (const char *cfg_name) | 318 | test_plugin (const char *cfg_name) |
@@ -307,7 +321,7 @@ test_plugin (const char *cfg_name) | |||
307 | struct GNUNET_CONFIGURATION_Handle *cfg; | 321 | struct GNUNET_CONFIGURATION_Handle *cfg; |
308 | struct GNUNET_DATASTORE_PluginFunctions *api; | 322 | struct GNUNET_DATASTORE_PluginFunctions *api; |
309 | struct GNUNET_DATASTORE_PluginEnvironment env; | 323 | struct GNUNET_DATASTORE_PluginEnvironment env; |
310 | 324 | ||
311 | cfg = GNUNET_CONFIGURATION_create (); | 325 | cfg = GNUNET_CONFIGURATION_create (); |
312 | if (GNUNET_OK != | 326 | if (GNUNET_OK != |
313 | GNUNET_CONFIGURATION_load (cfg, | 327 | GNUNET_CONFIGURATION_load (cfg, |
@@ -321,6 +335,7 @@ test_plugin (const char *cfg_name) | |||
321 | } | 335 | } |
322 | memset (&env, 0, sizeof (env)); | 336 | memset (&env, 0, sizeof (env)); |
323 | env.cfg = cfg; | 337 | env.cfg = cfg; |
338 | env.duc = &ignore_payload_cb; | ||
324 | GNUNET_snprintf (libname, | 339 | GNUNET_snprintf (libname, |
325 | sizeof (libname), | 340 | sizeof (libname), |
326 | "libgnunet_plugin_datastore_%s", | 341 | "libgnunet_plugin_datastore_%s", |