diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
commit | 416c2f5a713b93ba689a8cd1e038682a53e6bc17 (patch) | |
tree | 987f51d9edfddc02afe1524df5e1156b920c71d4 /src/datastore/test_plugin_datastore.c | |
parent | fceec98e767bce7ad2c24dde73cdcf8837e04013 (diff) | |
download | gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.tar.gz gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.zip |
-LRN: use FPRINTF -- #2051
Diffstat (limited to 'src/datastore/test_plugin_datastore.c')
-rw-r--r-- | src/datastore/test_plugin_datastore.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index 3504945ae..ca894ff33 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c | |||
@@ -118,7 +118,7 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) | |||
118 | msg = NULL; | 118 | msg = NULL; |
119 | prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100); | 119 | prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100); |
120 | #if VERBOSE | 120 | #if VERBOSE |
121 | fprintf (stderr, "putting type %u, anon %u under key %s\n", i + 1, i, | 121 | FPRINTF (stderr, "putting type %u, anon %u under key %s\n", i + 1, i, |
122 | GNUNET_h2s (&key)); | 122 | GNUNET_h2s (&key)); |
123 | #endif | 123 | #endif |
124 | if (GNUNET_OK != api->put (api->cls, &key, size, value, i + 1 /* type */ , | 124 | if (GNUNET_OK != api->put (api->cls, &key, size, value, i + 1 /* type */ , |
@@ -131,7 +131,7 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) | |||
131 | GNUNET_CRYPTO_random_u32 | 131 | GNUNET_CRYPTO_random_u32 |
132 | (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg)) | 132 | (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg)) |
133 | { | 133 | { |
134 | fprintf (stderr, "ERROR: `%s'\n", msg); | 134 | FPRINTF (stderr, "ERROR: `%s'\n", msg); |
135 | GNUNET_free_non_null (msg); | 135 | GNUNET_free_non_null (msg); |
136 | return; | 136 | return; |
137 | } | 137 | } |
@@ -160,7 +160,7 @@ iterate_one_shot (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
160 | guid = uid; | 160 | guid = uid; |
161 | crc->phase++; | 161 | crc->phase++; |
162 | #if VERBOSE | 162 | #if VERBOSE |
163 | fprintf (stderr, | 163 | FPRINTF (stderr, |
164 | "Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n", | 164 | "Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n", |
165 | type, priority, size, (unsigned long long) expiration.abs_value, | 165 | type, priority, size, (unsigned long long) expiration.abs_value, |
166 | GNUNET_h2s (key)); | 166 | GNUNET_h2s (key)); |
@@ -230,7 +230,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
230 | crc->phase = RP_ERROR; | 230 | crc->phase = RP_ERROR; |
231 | } | 231 | } |
232 | #if VERBOSE | 232 | #if VERBOSE |
233 | fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); | 233 | FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); |
234 | #endif | 234 | #endif |
235 | switch (crc->phase) | 235 | switch (crc->phase) |
236 | { | 236 | { |
@@ -324,7 +324,7 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
324 | GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); | 324 | GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); |
325 | if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) | 325 | if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) |
326 | { | 326 | { |
327 | fprintf (stderr, "Failed to load plugin `%s'!\n", name); | 327 | FPRINTF (stderr, "Failed to load plugin `%s'!\n", name); |
328 | return NULL; | 328 | return NULL; |
329 | } | 329 | } |
330 | GNUNET_free (libname); | 330 | GNUNET_free (libname); |
@@ -343,8 +343,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
343 | api = load_plugin (c); | 343 | api = load_plugin (c); |
344 | if (api == NULL) | 344 | if (api == NULL) |
345 | { | 345 | { |
346 | fprintf (stderr, | 346 | FPRINTF (stderr, |
347 | "Could not initialize plugin, assuming database not configured. Test not run!\n"); | 347 | "Could not initialize plugin, assuming database not configured. Test not run!\n", NULL); |
348 | return; | 348 | return; |
349 | } | 349 | } |
350 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 350 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); |
@@ -378,7 +378,7 @@ check () | |||
378 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, | 378 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, |
379 | "test-plugin-datastore", "nohelp", options, &run, NULL); | 379 | "test-plugin-datastore", "nohelp", options, &run, NULL); |
380 | if (ok != 0) | 380 | if (ok != 0) |
381 | fprintf (stderr, "Missed some testcases: %u\n", ok); | 381 | FPRINTF (stderr, "Missed some testcases: %u\n", ok); |
382 | return ok; | 382 | return ok; |
383 | } | 383 | } |
384 | 384 | ||