aboutsummaryrefslogtreecommitdiff
path: root/src/nse/test_nse_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-23 13:23:40 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-23 13:23:40 +0000
commitf53e991a59f4befa47b0ce90d8b68318dcd23864 (patch)
tree89dae5aaf3c8bef1fa1412133fe9d22d4f4e232d /src/nse/test_nse_api.c
parentc1ed03a28d6de09d7d0ac2025af9f8067e6bb0fd (diff)
downloadgnunet-f53e991a59f4befa47b0ce90d8b68318dcd23864.tar.gz
gnunet-f53e991a59f4befa47b0ce90d8b68318dcd23864.zip
nse hacking
Diffstat (limited to 'src/nse/test_nse_api.c')
-rw-r--r--src/nse/test_nse_api.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c
index 4f83a6d78..273cff294 100644
--- a/src/nse/test_nse_api.c
+++ b/src/nse/test_nse_api.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009 Christian Grothoff (and other contributing authors) 3 (C) 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -35,7 +35,7 @@
35 35
36static struct GNUNET_NSE_Handle *h; 36static struct GNUNET_NSE_Handle *h;
37 37
38GNUNET_SCHEDULER_TaskIdentifier die_task; 38static GNUNET_SCHEDULER_TaskIdentifier die_task;
39 39
40struct PeerContext 40struct PeerContext
41{ 41{
@@ -83,18 +83,19 @@ check_nse_message (void *cls, double estimate, double std_dev)
83 /* Fantastic check below. Expect NaN, the only thing not equal to itself. */ 83 /* Fantastic check below. Expect NaN, the only thing not equal to itself. */
84 if ((estimate != estimate) && (std_dev != std_dev)) 84 if ((estimate != estimate) && (std_dev != std_dev))
85 (*ok) = 0; 85 (*ok) = 0;
86
87 if (die_task != GNUNET_SCHEDULER_NO_TASK) 86 if (die_task != GNUNET_SCHEDULER_NO_TASK)
88 GNUNET_SCHEDULER_cancel(die_task); 87 GNUNET_SCHEDULER_cancel(die_task);
89 GNUNET_SCHEDULER_add_now(&end_test, NULL); 88 die_task = GNUNET_SCHEDULER_add_now(&end_test, NULL);
90} 89}
91 90
91
92static void 92static void
93setup_peer (struct PeerContext *p, const char *cfgname) 93setup_peer (struct PeerContext *p, const char *cfgname)
94{ 94{
95 p->cfg = GNUNET_CONFIGURATION_create (); 95 p->cfg = GNUNET_CONFIGURATION_create ();
96#if START_ARM 96#if START_ARM
97 p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", 97 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
98 "gnunet-service-arm",
98 "gnunet-service-arm", 99 "gnunet-service-arm",
99#if VERBOSE_ARM 100#if VERBOSE_ARM
100 "-L", "DEBUG", 101 "-L", "DEBUG",
@@ -118,6 +119,7 @@ stop_arm (struct PeerContext *p)
118 GNUNET_CONFIGURATION_destroy (p->cfg); 119 GNUNET_CONFIGURATION_destroy (p->cfg);
119} 120}
120 121
122
121static void 123static void
122run (void *cls, 124run (void *cls,
123 char *const *args, 125 char *const *args,
@@ -135,6 +137,7 @@ run (void *cls,
135 GNUNET_assert (h != NULL); 137 GNUNET_assert (h != NULL);
136} 138}
137 139
140
138static int 141static int
139check () 142check ()
140{ 143{
@@ -161,6 +164,7 @@ check ()
161 return ok; 164 return ok;
162} 165}
163 166
167
164int 168int
165main (int argc, char *argv[]) 169main (int argc, char *argv[])
166{ 170{