aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/test_datastore_api_management.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
committerNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
commit75a33a1499cf60ea4364c9aa673816629a6c1413 (patch)
tree0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/datastore/test_datastore_api_management.c
parent7217c601ad30760872823193d62307e7a335d226 (diff)
downloadgnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz
gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/datastore/test_datastore_api_management.c')
-rw-r--r--src/datastore/test_datastore_api_management.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index 81450d12a..d17d8fbc8 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -109,7 +109,6 @@ struct CpsRunContext
109 GNUNET_HashCode key; 109 GNUNET_HashCode key;
110 int i; 110 int i;
111 int found; 111 int found;
112 struct GNUNET_SCHEDULER_Handle *sched;
113 const struct GNUNET_CONFIGURATION_Handle *cfg; 112 const struct GNUNET_CONFIGURATION_Handle *cfg;
114 void *data; 113 void *data;
115 enum RunPhase phase; 114 enum RunPhase phase;
@@ -133,8 +132,7 @@ check_success (void *cls,
133 GNUNET_assert (GNUNET_OK == success); 132 GNUNET_assert (GNUNET_OK == success);
134 GNUNET_free_non_null (crc->data); 133 GNUNET_free_non_null (crc->data);
135 crc->data = NULL; 134 crc->data = NULL;
136 GNUNET_SCHEDULER_add_continuation (crc->sched, 135 GNUNET_SCHEDULER_add_continuation (&run_continuation,
137 &run_continuation,
138 crc, 136 crc,
139 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 137 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
140} 138}
@@ -170,8 +168,7 @@ check_value (void *cls,
170 } 168 }
171 if (0 == crc->i) 169 if (0 == crc->i)
172 crc->phase = RP_DONE; 170 crc->phase = RP_DONE;
173 GNUNET_SCHEDULER_add_continuation (crc->sched, 171 GNUNET_SCHEDULER_add_continuation (&run_continuation,
174 &run_continuation,
175 crc, 172 crc,
176 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 173 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
177 return; 174 return;
@@ -204,8 +201,7 @@ check_nothing (void *cls,
204 GNUNET_assert (key == NULL); 201 GNUNET_assert (key == NULL);
205 if (0 == --crc->i) 202 if (0 == --crc->i)
206 crc->phase = RP_DONE; 203 crc->phase = RP_DONE;
207 GNUNET_SCHEDULER_add_continuation (crc->sched, 204 GNUNET_SCHEDULER_add_continuation (&run_continuation,
208 &run_continuation,
209 crc, 205 crc,
210 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 206 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
211} 207}
@@ -307,8 +303,7 @@ run_tests (void *cls,
307 GNUNET_free (crc); 303 GNUNET_free (crc);
308 return; 304 return;
309 } 305 }
310 GNUNET_SCHEDULER_add_continuation (crc->sched, 306 GNUNET_SCHEDULER_add_continuation (&run_continuation,
311 &run_continuation,
312 crc, 307 crc,
313 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 308 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
314} 309}
@@ -316,7 +311,6 @@ run_tests (void *cls,
316 311
317static void 312static void
318run (void *cls, 313run (void *cls,
319 struct GNUNET_SCHEDULER_Handle *sched,
320 char *const *args, 314 char *const *args,
321 const char *cfgfile, 315 const char *cfgfile,
322 const struct GNUNET_CONFIGURATION_Handle *cfg) 316 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -325,11 +319,10 @@ run (void *cls,
325 static GNUNET_HashCode zkey; 319 static GNUNET_HashCode zkey;
326 320
327 crc = GNUNET_malloc(sizeof(struct CpsRunContext)); 321 crc = GNUNET_malloc(sizeof(struct CpsRunContext));
328 crc->sched = sched;
329 crc->cfg = cfg; 322 crc->cfg = cfg;
330 crc->phase = RP_PUT; 323 crc->phase = RP_PUT;
331 now = GNUNET_TIME_absolute_get (); 324 now = GNUNET_TIME_absolute_get ();
332 datastore = GNUNET_DATASTORE_connect (cfg, sched); 325 datastore = GNUNET_DATASTORE_connect (cfg);
333 if (NULL == 326 if (NULL ==
334 GNUNET_DATASTORE_put (datastore, 0, 327 GNUNET_DATASTORE_put (datastore, 0,
335 &zkey, 4, "TEST", 328 &zkey, 4, "TEST",