diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-04 23:32:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-04 23:32:09 +0200 |
commit | 324f6168c2374d7bb71c3632fb6521860d8fdfa1 (patch) | |
tree | 0fa116e131ce1f8e440093cd9ce696f8c0c82ff2 | |
parent | eec5a96f455942cac2f972f76babfe624849dccc (diff) |
testcase cleanup
-rw-r--r-- | src/datacache/test_datacache_quota.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c index 35357a8d28..b89d71a27c 100644 --- a/src/datacache/test_datacache_quota.c +++ b/src/datacache/test_datacache_quota.c @@ -49,8 +49,6 @@ run (void *cls, char *const *args, const char *cfgfile, struct GNUNET_DATACACHE_Handle *h; struct GNUNET_HashCode k; struct GNUNET_HashCode n; - unsigned int i; - unsigned int j; char buf[3200]; struct GNUNET_TIME_Absolute exp; @@ -59,36 +57,43 @@ run (void *cls, char *const *args, const char *cfgfile, if (h == NULL) { - FPRINTF (stderr, "%s", "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_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); memset (buf, 1, sizeof (buf)); memset (&k, 0, sizeof (struct GNUNET_HashCode)); - for (i = 0; i < 10; i++) + for (unsigned int i = 0; i < 10; i++) { - FPRINTF (stderr, "%s", "."); - GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); - for (j = i; j < sizeof (buf); j += 10) + FPRINTF (stderr, + "%s", + "."); + GNUNET_CRYPTO_hash (&k, + sizeof (struct GNUNET_HashCode), + &n); + for (unsigned int j = i; j < sizeof (buf); j += 10) { exp.abs_value_us++; buf[j] = i; - ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, - &k, - GNUNET_YES, - j, - buf, - 1 + i, - exp, - 0, - NULL)); + ASSERT (GNUNET_OK == + GNUNET_DATACACHE_put (h, + &k, + GNUNET_YES, + j, + buf, + 1 + i, + exp, + 0, + NULL)); ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL)); } k = n; } FPRINTF (stderr, "%s", "\n"); memset (&k, 0, sizeof (struct GNUNET_HashCode)); - for (i = 0; i < 10; i++) + for (unsigned int i = 0; i < 10; i++) { FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); |