* some of the data from the last iteration is still there.
*/
static void
-run (void *cls,
- char *const *args,
- const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct GNUNET_DATACACHE_Handle *h;
GNUNET_HashCode k;
if (h == NULL)
{
- fprintf (stderr,
- "Failed to initialize datacache. Database likely not setup, skipping test.\n");
+ FPRINTF (stderr, "%s", "Failed to initialize datacache. Database likely not setup, skipping test.\n");
return;
}
- exp = GNUNET_TIME_absolute_get ();
- exp.abs_value += 20 * 60 * 1000;
+ exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS);
memset (buf, 1, sizeof (buf));
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 10; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
for (j = i; j < sizeof (buf); j += 10)
{
}
k = n;
}
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 10; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
if (i < 2)
ASSERT (0 == GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL));
ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL));
k = n;
}
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_DATACACHE_destroy (h);
return;
FAILURE:
else
pos = (char *) plugin_name;
- GNUNET_snprintf (cfg_name,
- sizeof (cfg_name),
- "test_datacache_data_%s.conf", plugin_name);
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_datacache_data_%s.conf",
+ plugin_name);
if (pos != plugin_name)
pos[0] = '.';
- GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1,
- xargv, "test-datacache-quota", "nohelp",
- options, &run, NULL);
+ GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
+ "test-datacache-quota", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %d\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %d\n", ok);
return ok;
}