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.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/testbed/test_testbed_api_test_timeout.c b/src/testbed/test_testbed_api_test_timeout.c
index 68233e207..c5cfea7c0 100644
--- a/src/testbed/test_testbed_api_test_timeout.c
+++ b/src/testbed/test_testbed_api_test_timeout.c
@@ -1,22 +1,22 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2008--2013 GNUnet e.V. 3 Copyright (C) 2008--2013 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19 */
20 20
21/** 21/**
22 * @file src/testbed/test_testbed_api_test.c 22 * @file src/testbed/test_testbed_api_test.c
@@ -34,8 +34,8 @@
34/** 34/**
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,11 +52,11 @@ 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
@@ -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,16 @@ 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", NUM_PEERS,
117 event_mask, &controller_event_cb, NULL, 117 event_mask, &controller_event_cb, NULL,
118 &test_master, NULL); 118 &test_master, NULL);
119 if (GNUNET_OK != result) 119 if (GNUNET_OK != result)
120 return 1; 120 return 1;
121 return 0; 121 return 0;