* @param emsg any error message
* @return #GNUNET_YES (all good, continue)
*/
-static int
-iterate_cb (void *cls,
+static void
+iterate_cb (void *cls,
const struct GNUNET_PEERSTORE_Record *record,
const char *emsg)
{
GNUNET_break (NULL == emsg);
if (NULL == record)
{
- GNUNET_PEERSTORE_disconnect (h,
+ GNUNET_PEERSTORE_disconnect (h,
GNUNET_NO);
GNUNET_SCHEDULER_shutdown ();
- return GNUNET_YES;
+ return;
}
rec_val = record->value;
GNUNET_break (0 == strcmp (rec_val, val));
ok = 0;
- return GNUNET_YES;
}
* data that should have been stored.
*
* @param cls NULL
- * @param tc unused
*/
static void
-test_cont (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+test_cont (void *cls)
{
h = GNUNET_PEERSTORE_connect (cfg);
- GNUNET_PEERSTORE_iterate (h,
- subsystem,
+ GNUNET_PEERSTORE_iterate (h,
+ subsystem,
&pid, key,
- GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_TIME_UNIT_FOREVER_REL,
&iterate_cb, NULL);
}
test1 ()
{
h = GNUNET_PEERSTORE_connect (cfg);
- GNUNET_PEERSTORE_store (h,
+ GNUNET_PEERSTORE_store (h,
subsystem,
- &pid,
- key,
+ &pid,
+ key,
val, strlen (val) + 1,
GNUNET_TIME_UNIT_FOREVER_ABS,
- GNUNET_PEERSTORE_STOREOPTION_REPLACE,
+ GNUNET_PEERSTORE_STOREOPTION_REPLACE,
NULL, NULL);
- GNUNET_PEERSTORE_disconnect (h,
+ GNUNET_PEERSTORE_disconnect (h,
GNUNET_YES);
h = NULL;
/* We need to wait a little bit to give the disconnect
* @param peer handle to our peer (unused)
*/
static void
-run (void *cls,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *c,
struct GNUNET_TESTING_Peer *peer)
{
cfg = c;
- GNUNET_assert (NULL != h);
memset (&pid, 1, sizeof (pid));
test1 ();
}
main (int argc, char *argv[])
{
if (0 !=
- GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync",
+ GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync",
"peerstore",
"test_peerstore_api_data.conf",
&run, NULL))
if (0 != ok)
fprintf (stderr,
"Test failed: %d\n",
- ok).
+ ok);
return ok;
}