aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/test_testing_connect.c')
-rw-r--r--src/testing/test_testing_connect.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/testing/test_testing_connect.c b/src/testing/test_testing_connect.c
index 19e3bb1c0..4fe3a1dd6 100644
--- a/src/testing/test_testing_connect.c
+++ b/src/testing/test_testing_connect.c
@@ -90,8 +90,7 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
90} 90}
91 91
92static void 92static void
93my_connect_complete (void *cls, 93my_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first,
94 const struct GNUNET_PeerIdentity *first,
95 const struct GNUNET_PeerIdentity *second, 94 const struct GNUNET_PeerIdentity *second,
96 unsigned int distance, 95 unsigned int distance,
97 const struct GNUNET_CONFIGURATION_Handle *first_cfg, 96 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
@@ -105,32 +104,29 @@ my_connect_complete (void *cls,
105 104
106 105
107static void 106static void
108my_cb2 (void *cls, 107my_cb2 (void *cls, const struct GNUNET_PeerIdentity *id,
109 const struct GNUNET_PeerIdentity *id,
110 const struct GNUNET_CONFIGURATION_Handle *cfg, 108 const struct GNUNET_CONFIGURATION_Handle *cfg,
111 struct GNUNET_TESTING_Daemon *d, const char *emsg) 109 struct GNUNET_TESTING_Daemon *d, const char *emsg)
112{ 110{
113 GNUNET_assert (id != NULL); 111 GNUNET_assert (id != NULL);
114#if VERBOSE 112#if VERBOSE
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n",
116 "Daemon `%s' started.\n", GNUNET_i2s (id)); 114 GNUNET_i2s (id));
117#endif 115#endif
118 GNUNET_TESTING_daemons_connect (d1, d2, 116 GNUNET_TESTING_daemons_connect (d1, d2, TIMEOUT, CONNECT_ATTEMPTS, GNUNET_YES,
119 TIMEOUT, CONNECT_ATTEMPTS, 117 &my_connect_complete, NULL);
120 GNUNET_YES, &my_connect_complete, NULL);
121} 118}
122 119
123 120
124static void 121static void
125my_cb1 (void *cls, 122my_cb1 (void *cls, const struct GNUNET_PeerIdentity *id,
126 const struct GNUNET_PeerIdentity *id,
127 const struct GNUNET_CONFIGURATION_Handle *cfg, 123 const struct GNUNET_CONFIGURATION_Handle *cfg,
128 struct GNUNET_TESTING_Daemon *d, const char *emsg) 124 struct GNUNET_TESTING_Daemon *d, const char *emsg)
129{ 125{
130 GNUNET_assert (id != NULL); 126 GNUNET_assert (id != NULL);
131#if VERBOSE 127#if VERBOSE
132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 128 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon `%s' started.\n",
133 "Daemon `%s' started.\n", GNUNET_i2s (id)); 129 GNUNET_i2s (id));
134#endif 130#endif
135 d2 = GNUNET_TESTING_daemon_start (c2, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL, 131 d2 = GNUNET_TESTING_daemon_start (c2, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL,
136 NULL, NULL, &my_cb2, NULL); 132 NULL, NULL, &my_cb2, NULL);
@@ -140,9 +136,8 @@ my_cb1 (void *cls,
140 136
141 137
142static void 138static void
143run (void *cls, 139run (void *cls, char *const *args, const char *cfgfile,
144 char *const *args, 140 const struct GNUNET_CONFIGURATION_Handle *cfg)
145 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
146{ 141{
147 ok = 1; 142 ok = 1;
148#if VERBOSE 143#if VERBOSE
@@ -171,9 +166,8 @@ check ()
171 struct GNUNET_GETOPT_CommandLineOption options[] = { 166 struct GNUNET_GETOPT_CommandLineOption options[] = {
172 GNUNET_GETOPT_OPTION_END 167 GNUNET_GETOPT_OPTION_END
173 }; 168 };
174 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, 169 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
175 argv, "test-testing-connect", "nohelp", 170 "test-testing-connect", "nohelp", options, &run, &ok);
176 options, &run, &ok);
177 return ok; 171 return ok;
178} 172}
179 173