aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_connection_timeout_no_connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/test_connection_timeout_no_connect.c')
-rw-r--r--src/util/test_connection_timeout_no_connect.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/util/test_connection_timeout_no_connect.c b/src/util/test_connection_timeout_no_connect.c
index 2e8f9be2e..50eaf709a 100644
--- a/src/util/test_connection_timeout_no_connect.c
+++ b/src/util/test_connection_timeout_no_connect.c
@@ -27,8 +27,6 @@
27#include "gnunet_scheduler_lib.h" 27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h" 28#include "gnunet_time_lib.h"
29 29
30#define VERBOSE GNUNET_NO
31
32#define PORT 13425 30#define PORT 13425
33 31
34static struct GNUNET_CONNECTION_Handle *csock; 32static struct GNUNET_CONNECTION_Handle *csock;
@@ -40,10 +38,7 @@ handle_timeout (void *cls, size_t size, void *buf)
40{ 38{
41 int *ok = cls; 39 int *ok = cls;
42 40
43#if VERBOSE
44 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received timeout signal.\n"); 41 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received timeout signal.\n");
45#endif
46
47 GNUNET_assert (size == 0); 42 GNUNET_assert (size == 0);
48 GNUNET_assert (buf == NULL); 43 GNUNET_assert (buf == NULL);
49 *ok = 0; 44 *ok = 0;
@@ -64,15 +59,14 @@ task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64} 59}
65 60
66 61
67 62int
68/** 63main (int argc, char *argv[])
69 * Main method, starts scheduler with task_timeout.
70 */
71static int
72check_timeout ()
73{ 64{
74 int ok; 65 int ok;
75 66
67 GNUNET_log_setup ("test_connection_timeout_no_connect",
68 "WARNING",
69 NULL);
76 ok = 1; 70 ok = 1;
77 cfg = GNUNET_CONFIGURATION_create (); 71 cfg = GNUNET_CONFIGURATION_create ();
78 GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME", 72 GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
@@ -82,20 +76,4 @@ check_timeout ()
82 return ok; 76 return ok;
83} 77}
84 78
85int
86main (int argc, char *argv[])
87{
88 int ret = 0;
89
90 GNUNET_log_setup ("test_connection_timeout_no_connect",
91#if VERBOSE
92 "DEBUG",
93#else
94 "WARNING",
95#endif
96 NULL);
97 ret += check_timeout ();
98 return ret;
99}
100
101/* end of test_connection_timeout_no_connect.c */ 79/* end of test_connection_timeout_no_connect.c */