diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/include/gnunet_testing_lib.h | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 370360eb1..3c3ef8f2e 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -56,7 +56,8 @@ extern "C" | |||
56 | /** | 56 | /** |
57 | * Size of each hostkey in the hostkey file (in BYTES). | 57 | * Size of each hostkey in the hostkey file (in BYTES). |
58 | */ | 58 | */ |
59 | #define GNUNET_TESTING_HOSTKEYFILESIZE sizeof(struct GNUNET_CRYPTO_EddsaPrivateKey) | 59 | #define GNUNET_TESTING_HOSTKEYFILESIZE sizeof(struct \ |
60 | GNUNET_CRYPTO_EddsaPrivateKey) | ||
60 | 61 | ||
61 | /** | 62 | /** |
62 | * The environmental variable, if set, that dictates where testing should place | 63 | * The environmental variable, if set, that dictates where testing should place |
@@ -81,7 +82,8 @@ struct GNUNET_TESTING_Peer; | |||
81 | /** | 82 | /** |
82 | * Specification of a service that is to be shared among peers | 83 | * Specification of a service that is to be shared among peers |
83 | */ | 84 | */ |
84 | struct GNUNET_TESTING_SharedService { | 85 | struct GNUNET_TESTING_SharedService |
86 | { | ||
85 | /** | 87 | /** |
86 | * The name of the service. | 88 | * The name of the service. |
87 | */ | 89 | */ |
@@ -121,11 +123,11 @@ struct GNUNET_TESTING_SharedService { | |||
121 | * @return handle to this system, NULL on error | 123 | * @return handle to this system, NULL on error |
122 | */ | 124 | */ |
123 | struct GNUNET_TESTING_System * | 125 | struct GNUNET_TESTING_System * |
124 | GNUNET_TESTING_system_create(const char *testdir, | 126 | GNUNET_TESTING_system_create (const char *testdir, |
125 | const char *trusted_ip, | 127 | const char *trusted_ip, |
126 | const char *hostname, | 128 | const char *hostname, |
127 | const struct GNUNET_TESTING_SharedService * | 129 | const struct GNUNET_TESTING_SharedService * |
128 | shared_services); | 130 | shared_services); |
129 | 131 | ||
130 | 132 | ||
131 | /** | 133 | /** |
@@ -153,12 +155,14 @@ GNUNET_TESTING_system_create(const char *testdir, | |||
153 | * @return handle to this system, NULL on error | 155 | * @return handle to this system, NULL on error |
154 | */ | 156 | */ |
155 | struct GNUNET_TESTING_System * | 157 | struct GNUNET_TESTING_System * |
156 | GNUNET_TESTING_system_create_with_portrange(const char *testdir, | 158 | GNUNET_TESTING_system_create_with_portrange (const char *testdir, |
157 | const char *trusted_ip, | 159 | const char *trusted_ip, |
158 | const char *hostname, | 160 | const char *hostname, |
159 | const struct GNUNET_TESTING_SharedService *shared_services, | 161 | const struct |
160 | uint16_t lowport, | 162 | GNUNET_TESTING_SharedService * |
161 | uint16_t highport); | 163 | shared_services, |
164 | uint16_t lowport, | ||
165 | uint16_t highport); | ||
162 | 166 | ||
163 | 167 | ||
164 | /** | 168 | /** |
@@ -169,8 +173,8 @@ GNUNET_TESTING_system_create_with_portrange(const char *testdir, | |||
169 | * be removed (clean up on shutdown)? | 173 | * be removed (clean up on shutdown)? |
170 | */ | 174 | */ |
171 | void | 175 | void |
172 | GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system, | 176 | GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system, |
173 | int remove_paths); | 177 | int remove_paths); |
174 | 178 | ||
175 | 179 | ||
176 | /** | 180 | /** |
@@ -191,9 +195,9 @@ GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system, | |||
191 | * @return NULL on error (not enough keys) | 195 | * @return NULL on error (not enough keys) |
192 | */ | 196 | */ |
193 | struct GNUNET_CRYPTO_EddsaPrivateKey * | 197 | struct GNUNET_CRYPTO_EddsaPrivateKey * |
194 | GNUNET_TESTING_hostkey_get(const struct GNUNET_TESTING_System *system, | 198 | GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, |
195 | uint32_t key_number, | 199 | uint32_t key_number, |
196 | struct GNUNET_PeerIdentity *id); | 200 | struct GNUNET_PeerIdentity *id); |
197 | 201 | ||
198 | 202 | ||
199 | /** | 203 | /** |
@@ -203,7 +207,7 @@ GNUNET_TESTING_hostkey_get(const struct GNUNET_TESTING_System *system, | |||
203 | * @return 0 if no free port was available | 207 | * @return 0 if no free port was available |
204 | */ | 208 | */ |
205 | uint16_t | 209 | uint16_t |
206 | GNUNET_TESTING_reserve_port(struct GNUNET_TESTING_System *system); | 210 | GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system); |
207 | 211 | ||
208 | 212 | ||
209 | /** | 213 | /** |
@@ -214,8 +218,8 @@ GNUNET_TESTING_reserve_port(struct GNUNET_TESTING_System *system); | |||
214 | * @param port reserved port to release | 218 | * @param port reserved port to release |
215 | */ | 219 | */ |
216 | void | 220 | void |
217 | GNUNET_TESTING_release_port(struct GNUNET_TESTING_System *system, | 221 | GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system, |
218 | uint16_t port); | 222 | uint16_t port); |
219 | 223 | ||
220 | 224 | ||
221 | /** | 225 | /** |
@@ -236,8 +240,8 @@ GNUNET_TESTING_release_port(struct GNUNET_TESTING_System *system, | |||
236 | * be incomplete and should not be used there upon | 240 | * be incomplete and should not be used there upon |
237 | */ | 241 | */ |
238 | int | 242 | int |
239 | GNUNET_TESTING_configuration_create(struct GNUNET_TESTING_System *system, | 243 | GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system, |
240 | struct GNUNET_CONFIGURATION_Handle *cfg); | 244 | struct GNUNET_CONFIGURATION_Handle *cfg); |
241 | // FIXME: add dual to 'release' ports again... | 245 | // FIXME: add dual to 'release' ports again... |
242 | 246 | ||
243 | 247 | ||
@@ -255,11 +259,11 @@ GNUNET_TESTING_configuration_create(struct GNUNET_TESTING_System *system, | |||
255 | * @return handle to the peer, NULL on error | 259 | * @return handle to the peer, NULL on error |
256 | */ | 260 | */ |
257 | struct GNUNET_TESTING_Peer * | 261 | struct GNUNET_TESTING_Peer * |
258 | GNUNET_TESTING_peer_configure(struct GNUNET_TESTING_System *system, | 262 | GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, |
259 | struct GNUNET_CONFIGURATION_Handle *cfg, | 263 | struct GNUNET_CONFIGURATION_Handle *cfg, |
260 | uint32_t key_number, | 264 | uint32_t key_number, |
261 | struct GNUNET_PeerIdentity *id, | 265 | struct GNUNET_PeerIdentity *id, |
262 | char **emsg); | 266 | char **emsg); |
263 | 267 | ||
264 | 268 | ||
265 | /** | 269 | /** |
@@ -269,8 +273,8 @@ GNUNET_TESTING_peer_configure(struct GNUNET_TESTING_System *system, | |||
269 | * @param id identifier for the daemon, will be set | 273 | * @param id identifier for the daemon, will be set |
270 | */ | 274 | */ |
271 | void | 275 | void |
272 | GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer, | 276 | GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer, |
273 | struct GNUNET_PeerIdentity *id); | 277 | struct GNUNET_PeerIdentity *id); |
274 | 278 | ||
275 | 279 | ||
276 | /** | 280 | /** |
@@ -281,7 +285,7 @@ GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer, | |||
281 | * #GNUNET_SYSERR on error (i.e. peer already running) | 285 | * #GNUNET_SYSERR on error (i.e. peer already running) |
282 | */ | 286 | */ |
283 | int | 287 | int |
284 | GNUNET_TESTING_peer_start(struct GNUNET_TESTING_Peer *peer); | 288 | GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer); |
285 | 289 | ||
286 | 290 | ||
287 | /** | 291 | /** |
@@ -294,7 +298,7 @@ GNUNET_TESTING_peer_start(struct GNUNET_TESTING_Peer *peer); | |||
294 | * #GNUNET_SYSERR on error (i.e. peer not running) | 298 | * #GNUNET_SYSERR on error (i.e. peer not running) |
295 | */ | 299 | */ |
296 | int | 300 | int |
297 | GNUNET_TESTING_peer_stop(struct GNUNET_TESTING_Peer *peer); | 301 | GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer); |
298 | 302 | ||
299 | 303 | ||
300 | /** | 304 | /** |
@@ -305,7 +309,7 @@ GNUNET_TESTING_peer_stop(struct GNUNET_TESTING_Peer *peer); | |||
305 | * @param peer peer to destroy | 309 | * @param peer peer to destroy |
306 | */ | 310 | */ |
307 | void | 311 | void |
308 | GNUNET_TESTING_peer_destroy(struct GNUNET_TESTING_Peer *peer); | 312 | GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer); |
309 | 313 | ||
310 | 314 | ||
311 | /** | 315 | /** |
@@ -316,7 +320,7 @@ GNUNET_TESTING_peer_destroy(struct GNUNET_TESTING_Peer *peer); | |||
316 | * or upon any error while sending SIGTERM | 320 | * or upon any error while sending SIGTERM |
317 | */ | 321 | */ |
318 | int | 322 | int |
319 | GNUNET_TESTING_peer_kill(struct GNUNET_TESTING_Peer *peer); | 323 | GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer); |
320 | 324 | ||
321 | 325 | ||
322 | /** | 326 | /** |
@@ -327,7 +331,7 @@ GNUNET_TESTING_peer_kill(struct GNUNET_TESTING_Peer *peer); | |||
327 | * or upon any error while waiting | 331 | * or upon any error while waiting |
328 | */ | 332 | */ |
329 | int | 333 | int |
330 | GNUNET_TESTING_peer_wait(struct GNUNET_TESTING_Peer *peer); | 334 | GNUNET_TESTING_peer_wait (struct GNUNET_TESTING_Peer *peer); |
331 | 335 | ||
332 | 336 | ||
333 | /** | 337 | /** |
@@ -356,9 +360,9 @@ typedef void | |||
356 | * upon any error. | 360 | * upon any error. |
357 | */ | 361 | */ |
358 | int | 362 | int |
359 | GNUNET_TESTING_peer_stop_async(struct GNUNET_TESTING_Peer *peer, | 363 | GNUNET_TESTING_peer_stop_async (struct GNUNET_TESTING_Peer *peer, |
360 | GNUNET_TESTING_PeerStopCallback cb, | 364 | GNUNET_TESTING_PeerStopCallback cb, |
361 | void *cb_cls); | 365 | void *cb_cls); |
362 | 366 | ||
363 | 367 | ||
364 | /** | 368 | /** |
@@ -371,7 +375,7 @@ GNUNET_TESTING_peer_stop_async(struct GNUNET_TESTING_Peer *peer, | |||
371 | * before. | 375 | * before. |
372 | */ | 376 | */ |
373 | void | 377 | void |
374 | GNUNET_TESTING_peer_stop_async_cancel(struct GNUNET_TESTING_Peer *peer); | 378 | GNUNET_TESTING_peer_stop_async_cancel (struct GNUNET_TESTING_Peer *peer); |
375 | 379 | ||
376 | 380 | ||
377 | /** | 381 | /** |
@@ -405,10 +409,10 @@ typedef void | |||
405 | * @return 0 on success, 1 on error | 409 | * @return 0 on success, 1 on error |
406 | */ | 410 | */ |
407 | int | 411 | int |
408 | GNUNET_TESTING_peer_run(const char *testdir, | 412 | GNUNET_TESTING_peer_run (const char *testdir, |
409 | const char *cfgfilename, | 413 | const char *cfgfilename, |
410 | GNUNET_TESTING_TestMain tm, | 414 | GNUNET_TESTING_TestMain tm, |
411 | void *tm_cls); | 415 | void *tm_cls); |
412 | 416 | ||
413 | 417 | ||
414 | /** | 418 | /** |
@@ -433,11 +437,11 @@ GNUNET_TESTING_peer_run(const char *testdir, | |||
433 | * @return 0 on success, 1 on error | 437 | * @return 0 on success, 1 on error |
434 | */ | 438 | */ |
435 | int | 439 | int |
436 | GNUNET_TESTING_service_run(const char *testdir, | 440 | GNUNET_TESTING_service_run (const char *testdir, |
437 | const char *service_name, | 441 | const char *service_name, |
438 | const char *cfgfilename, | 442 | const char *cfgfilename, |
439 | GNUNET_TESTING_TestMain tm, | 443 | GNUNET_TESTING_TestMain tm, |
440 | void *tm_cls); | 444 | void *tm_cls); |
441 | 445 | ||
442 | 446 | ||
443 | /** | 447 | /** |
@@ -454,7 +458,7 @@ GNUNET_TESTING_service_run(const char *testdir, | |||
454 | * NULL if argv0 has no '_' | 458 | * NULL if argv0 has no '_' |
455 | */ | 459 | */ |
456 | char * | 460 | char * |
457 | GNUNET_TESTING_get_testname_from_underscore(const char *argv0); | 461 | GNUNET_TESTING_get_testname_from_underscore (const char *argv0); |
458 | 462 | ||
459 | 463 | ||
460 | #if 0 /* keep Emacsens' auto-indent happy */ | 464 | #if 0 /* keep Emacsens' auto-indent happy */ |