diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-02-04 10:49:38 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-02-04 10:49:38 +0000 |
commit | b5aa0a257534ae85626811c0426fe27213d4f178 (patch) | |
tree | d7db993b54aa8ea144485b1ee130f9122fb53ad4 /src | |
parent | 2d2a7b873331ee2127cecec384b746228ee563b4 (diff) | |
download | gnunet-b5aa0a257534ae85626811c0426fe27213d4f178.tar.gz gnunet-b5aa0a257534ae85626811c0426fe27213d4f178.zip |
test case changes
Diffstat (limited to 'src')
-rw-r--r-- | src/core/test_core_api.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index c931fccc2..9fafb10de 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "gnunet_scheduler_lib.h" | 34 | #include "gnunet_scheduler_lib.h" |
35 | #include "gnunet_transport_service.h" | 35 | #include "gnunet_transport_service.h" |
36 | 36 | ||
37 | #define VERBOSE GNUNET_YES | 37 | #define VERBOSE GNUNET_NO |
38 | 38 | ||
39 | #define START_ARM GNUNET_YES | 39 | #define START_ARM GNUNET_YES |
40 | 40 | ||
@@ -42,7 +42,7 @@ | |||
42 | /** | 42 | /** |
43 | * How long until we give up on transmitting the message? | 43 | * How long until we give up on transmitting the message? |
44 | */ | 44 | */ |
45 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 6) | 45 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) |
46 | 46 | ||
47 | #define MTYPE 12345 | 47 | #define MTYPE 12345 |
48 | 48 | ||
@@ -78,6 +78,9 @@ static void | |||
78 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 78 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
79 | { | 79 | { |
80 | GNUNET_assert (ok == 6); | 80 | GNUNET_assert (ok == 6); |
81 | #if VERBOSE | ||
82 | fprintf(stderr, "ENDING WELL %u\n", ok); | ||
83 | #endif | ||
81 | GNUNET_CORE_disconnect (p1.ch); | 84 | GNUNET_CORE_disconnect (p1.ch); |
82 | GNUNET_CORE_disconnect (p2.ch); | 85 | GNUNET_CORE_disconnect (p2.ch); |
83 | GNUNET_TRANSPORT_disconnect (p1.th); | 86 | GNUNET_TRANSPORT_disconnect (p1.th); |
@@ -91,6 +94,9 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
91 | static void | 94 | static void |
92 | terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 95 | terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
93 | { | 96 | { |
97 | #if VERBOSE | ||
98 | fprintf(stderr, "ENDING ANGRILY %u\n", ok); | ||
99 | #endif | ||
94 | GNUNET_break (0); | 100 | GNUNET_break (0); |
95 | GNUNET_CORE_disconnect (p1.ch); | 101 | GNUNET_CORE_disconnect (p1.ch); |
96 | GNUNET_CORE_disconnect (p2.ch); | 102 | GNUNET_CORE_disconnect (p2.ch); |
@@ -192,7 +198,7 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
192 | m->size = htons (sizeof (struct GNUNET_MessageHeader)); | 198 | m->size = htons (sizeof (struct GNUNET_MessageHeader)); |
193 | err_task = | 199 | err_task = |
194 | GNUNET_SCHEDULER_add_delayed (sched, | 200 | GNUNET_SCHEDULER_add_delayed (sched, |
195 | TIMEOUT, &terminate_task_error, NULL); | 201 | GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 120), &terminate_task_error, NULL); |
196 | 202 | ||
197 | return sizeof (struct GNUNET_MessageHeader); | 203 | return sizeof (struct GNUNET_MessageHeader); |
198 | } | 204 | } |
@@ -238,12 +244,18 @@ init_notify (void *cls, | |||
238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
239 | "Asking core (1) for transmission to peer `%4s'\n", | 245 | "Asking core (1) for transmission to peer `%4s'\n", |
240 | GNUNET_i2s (&p2.id)); | 246 | GNUNET_i2s (&p2.id)); |
241 | GNUNET_CORE_notify_transmit_ready (p1.ch, | 247 | |
248 | if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch, | ||
242 | 0, | 249 | 0, |
243 | TIMEOUT, | 250 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15), |
244 | &p2.id, | 251 | &p2.id, |
245 | sizeof (struct GNUNET_MessageHeader), | 252 | sizeof (struct GNUNET_MessageHeader), |
246 | &transmit_ready, &p1); | 253 | &transmit_ready, &p1)) |
254 | { | ||
255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
256 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", | ||
257 | GNUNET_i2s (&p2.id)); | ||
258 | } | ||
247 | 259 | ||
248 | } | 260 | } |
249 | } | 261 | } |