diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-13 20:05:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-13 20:05:40 +0000 |
commit | 4e1d85bac66209e6655f3fb4d3ddef7929f0f3fc (patch) | |
tree | df5c5a0d972f35d741b51c3a3fc8d2298ac8b4fd /src/datacache/test_datacache.c | |
parent | 855362e698928b0a5a8f72fc6427c2ea42af4e79 (diff) | |
download | gnunet-4e1d85bac66209e6655f3fb4d3ddef7929f0f3fc.tar.gz gnunet-4e1d85bac66209e6655f3fb4d3ddef7929f0f3fc.zip |
changing datacache API to separate put-paths from data (so that plugins can test for duplicates), removing support for MySQL
Diffstat (limited to 'src/datacache/test_datacache.c')
-rw-r--r-- | src/datacache/test_datacache.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c index 1d8cd3295..5162924f7 100644 --- a/src/datacache/test_datacache.c +++ b/src/datacache/test_datacache.c | |||
@@ -38,9 +38,13 @@ static const char *plugin_name; | |||
38 | 38 | ||
39 | 39 | ||
40 | static int | 40 | static int |
41 | checkIt (void *cls, struct GNUNET_TIME_Absolute exp, | 41 | checkIt (void *cls, |
42 | const struct GNUNET_HashCode * key, size_t size, const char *data, | 42 | const struct GNUNET_HashCode *key, |
43 | enum GNUNET_BLOCK_Type type) | 43 | size_t size, const char *data, |
44 | enum GNUNET_BLOCK_Type type, | ||
45 | struct GNUNET_TIME_Absolute exp, | ||
46 | unsigned int path_len, | ||
47 | const struct GNUNET_PeerIdentity *path) | ||
44 | { | 48 | { |
45 | if (size != sizeof (struct GNUNET_HashCode)) | 49 | if (size != sizeof (struct GNUNET_HashCode)) |
46 | { | 50 | { |
@@ -83,7 +87,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
83 | GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); | 87 | GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); |
84 | ASSERT (GNUNET_OK == | 88 | ASSERT (GNUNET_OK == |
85 | GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode), | 89 | GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode), |
86 | (const char *) &n, 1 + i % 16, exp)); | 90 | (const char *) &n, 1 + i % 16, exp, |
91 | 0, NULL)); | ||
87 | k = n; | 92 | k = n; |
88 | } | 93 | } |
89 | memset (&k, 0, sizeof (struct GNUNET_HashCode)); | 94 | memset (&k, 0, sizeof (struct GNUNET_HashCode)); |
@@ -99,7 +104,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
99 | ASSERT (GNUNET_OK == | 104 | ASSERT (GNUNET_OK == |
100 | GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode), | 105 | GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode), |
101 | (const char *) &n, 792, | 106 | (const char *) &n, 792, |
102 | GNUNET_TIME_UNIT_FOREVER_ABS)); | 107 | GNUNET_TIME_UNIT_FOREVER_ABS, |
108 | 0, NULL)); | ||
103 | ASSERT (0 != GNUNET_DATACACHE_get (h, &k, 792, &checkIt, &n)); | 109 | ASSERT (0 != GNUNET_DATACACHE_get (h, &k, 792, &checkIt, &n)); |
104 | 110 | ||
105 | GNUNET_DATACACHE_destroy (h); | 111 | GNUNET_DATACACHE_destroy (h); |