summaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_test_timeout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/test_testbed_api_test_timeout.c')
-rw-r--r--src/testbed/test_testbed_api_test_timeout.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/testbed/test_testbed_api_test_timeout.c b/src/testbed/test_testbed_api_test_timeout.c
index c5cfea7c0..65cda0b33 100644
--- a/src/testbed/test_testbed_api_test_timeout.c
+++ b/src/testbed/test_testbed_api_test_timeout.c
@@ -35,7 +35,7 @@
35 * Generic logging shortcut 35 * Generic logging shortcut
36 */ 36 */
37#define LOG(kind, ...) \ 37#define LOG(kind, ...) \
38 GNUNET_log(kind, __VA_ARGS__) 38 GNUNET_log (kind, __VA_ARGS__)
39 39
40/** 40/**
41 * Number of peers we want to start 41 * Number of peers we want to start
@@ -52,12 +52,12 @@ static int result;
52 * shortcut to exit during failure 52 * shortcut to exit during failure
53 */ 53 */
54#define FAIL_TEST(cond) do { \ 54#define FAIL_TEST(cond) do { \
55 if (!(cond)) { \ 55 if (! (cond)) { \
56 GNUNET_break(0); \ 56 GNUNET_break (0); \
57 GNUNET_SCHEDULER_shutdown(); \ 57 GNUNET_SCHEDULER_shutdown (); \
58 return; \ 58 return; \
59 } \ 59 } \
60 } while (0) 60} while (0)
61 61
62 62
63/** 63/**
@@ -67,10 +67,10 @@ static int result;
67 * @param event the controller event 67 * @param event the controller event
68 */ 68 */
69static void 69static void
70controller_event_cb(void *cls, 70controller_event_cb (void *cls,
71 const struct GNUNET_TESTBED_EventInformation *event) 71 const struct GNUNET_TESTBED_EventInformation *event)
72{ 72{
73 FAIL_TEST(0); 73 FAIL_TEST (0);
74} 74}
75 75
76 76
@@ -87,18 +87,18 @@ controller_event_cb(void *cls,
87 * failed 87 * failed
88 */ 88 */
89static void 89static void
90test_master(void *cls, 90test_master (void *cls,
91 struct GNUNET_TESTBED_RunHandle *h, 91 struct GNUNET_TESTBED_RunHandle *h,
92 unsigned int num_peers, 92 unsigned int num_peers,
93 struct GNUNET_TESTBED_Peer **peers_, 93 struct GNUNET_TESTBED_Peer **peers_,
94 unsigned int links_succeeded, 94 unsigned int links_succeeded,
95 unsigned int links_failed) 95 unsigned int links_failed)
96{ 96{
97 FAIL_TEST(NULL == cls); 97 FAIL_TEST (NULL == cls);
98 FAIL_TEST(0 == num_peers); 98 FAIL_TEST (0 == num_peers);
99 FAIL_TEST(NULL == peers_); 99 FAIL_TEST (NULL == peers_);
100 result = GNUNET_OK; 100 result = GNUNET_OK;
101 GNUNET_SCHEDULER_shutdown(); 101 GNUNET_SCHEDULER_shutdown ();
102} 102}
103 103
104 104
@@ -106,16 +106,17 @@ test_master(void *cls,
106 * Main function 106 * Main function
107 */ 107 */
108int 108int
109main(int argc, char **argv) 109main (int argc, char **argv)
110{ 110{
111 uint64_t event_mask; 111 uint64_t event_mask;
112 112
113 result = GNUNET_SYSERR; 113 result = GNUNET_SYSERR;
114 event_mask = 0; 114 event_mask = 0;
115 (void)GNUNET_TESTBED_test_run("test_testbed_api_test", 115 (void) GNUNET_TESTBED_test_run ("test_testbed_api_test",
116 "test_testbed_api_test_timeout.conf", NUM_PEERS, 116 "test_testbed_api_test_timeout.conf",
117 event_mask, &controller_event_cb, NULL, 117 NUM_PEERS,
118 &test_master, NULL); 118 event_mask, &controller_event_cb, NULL,
119 &test_master, NULL);
119 if (GNUNET_OK != result) 120 if (GNUNET_OK != result)
120 return 1; 121 return 1;
121 return 0; 122 return 0;