aboutsummaryrefslogtreecommitdiff
path: root/src/peerstore/test_peerstore_api_sync.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-11 21:37:41 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-10-11 21:37:41 +0200
commit8ed3ad85fa8c0faa213157610379d69875b10ccb (patch)
tree49761ce436b94bdba26344cab2b7b6fe26e15df6 /src/peerstore/test_peerstore_api_sync.c
parent1e023a539b4f0b9f68ae6948d3328eafb7ba49e2 (diff)
downloadgnunet-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.c16
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,
109static void 109static void
110test_cont (void *cls) 110test_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
119static void 120static void
121disc_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
130static void
120store_cont (void *cls, int success) 131store_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/**