diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-11 21:37:41 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-11 21:37:41 +0200 |
commit | 8ed3ad85fa8c0faa213157610379d69875b10ccb (patch) | |
tree | 49761ce436b94bdba26344cab2b7b6fe26e15df6 /src/peerstore/test_peerstore_api_sync.c | |
parent | 1e023a539b4f0b9f68ae6948d3328eafb7ba49e2 (diff) | |
download | gnunet-8ed3ad85fa8c0faa213157610379d69875b10ccb.tar.gz gnunet-8ed3ad85fa8c0faa213157610379d69875b10ccb.zip |
we probably want to actually test the sync
Diffstat (limited to 'src/peerstore/test_peerstore_api_sync.c')
-rw-r--r-- | src/peerstore/test_peerstore_api_sync.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/peerstore/test_peerstore_api_sync.c b/src/peerstore/test_peerstore_api_sync.c index 503cb2f1e..bfeae6ed8 100644 --- a/src/peerstore/test_peerstore_api_sync.c +++ b/src/peerstore/test_peerstore_api_sync.c | |||
@@ -109,6 +109,7 @@ iterate_cb (void *cls, | |||
109 | static void | 109 | static void |
110 | test_cont (void *cls) | 110 | test_cont (void *cls) |
111 | { | 111 | { |
112 | h = GNUNET_PEERSTORE_connect (cfg); | ||
112 | GNUNET_PEERSTORE_iterate (h, | 113 | GNUNET_PEERSTORE_iterate (h, |
113 | subsystem, | 114 | subsystem, |
114 | &pid, key, | 115 | &pid, key, |
@@ -117,6 +118,16 @@ test_cont (void *cls) | |||
117 | } | 118 | } |
118 | 119 | ||
119 | static void | 120 | static void |
121 | disc_cont (void *cls) | ||
122 | { | ||
123 | GNUNET_PEERSTORE_disconnect (h, GNUNET_YES); | ||
124 | h = NULL; | ||
125 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | ||
126 | &test_cont, | ||
127 | NULL); | ||
128 | } | ||
129 | |||
130 | static void | ||
120 | store_cont (void *cls, int success) | 131 | store_cont (void *cls, int success) |
121 | { | 132 | { |
122 | ok = success; | 133 | ok = success; |
@@ -125,9 +136,8 @@ store_cont (void *cls, int success) | |||
125 | the test may fail non-deterministically if the new | 136 | the test may fail non-deterministically if the new |
126 | connection is faster than the cleanup routine of the | 137 | connection is faster than the cleanup routine of the |
127 | old one. */ | 138 | old one. */ |
128 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 139 | GNUNET_SCHEDULER_add_now (&disc_cont, |
129 | &test_cont, | 140 | NULL); |
130 | NULL); | ||
131 | } | 141 | } |
132 | 142 | ||
133 | /** | 143 | /** |