diff options
-rw-r--r-- | src/conversation/test_conversation_api.c | 48 | ||||
-rw-r--r-- | src/conversation/test_conversation_api_reject.c | 38 | ||||
-rw-r--r-- | src/conversation/test_conversation_api_twocalls.c | 66 |
3 files changed, 123 insertions, 29 deletions
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c index 0bf173d2b..180f6619f 100644 --- a/src/conversation/test_conversation_api.c +++ b/src/conversation/test_conversation_api.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013, 2014 GNUnet e.V. | 3 | Copyright (C) 2013, 2014, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -78,6 +78,7 @@ phone_send (void *cls) | |||
78 | static unsigned int i; | 78 | static unsigned int i; |
79 | char buf[32]; | 79 | char buf[32]; |
80 | 80 | ||
81 | (void) cls; | ||
81 | GNUNET_assert (NULL != phone_rdc); | 82 | GNUNET_assert (NULL != phone_rdc); |
82 | GNUNET_snprintf (buf, sizeof (buf), "phone-%u", i++); | 83 | GNUNET_snprintf (buf, sizeof (buf), "phone-%u", i++); |
83 | phone_rdc (phone_rdc_cls, strlen (buf) + 1, buf); | 84 | phone_rdc (phone_rdc_cls, strlen (buf) + 1, buf); |
@@ -92,6 +93,7 @@ call_send (void *cls) | |||
92 | static unsigned int i; | 93 | static unsigned int i; |
93 | char buf[32]; | 94 | char buf[32]; |
94 | 95 | ||
96 | (void) cls; | ||
95 | GNUNET_assert (NULL != call_rdc); | 97 | GNUNET_assert (NULL != call_rdc); |
96 | GNUNET_snprintf (buf, sizeof (buf), "call-%u", i++); | 98 | GNUNET_snprintf (buf, sizeof (buf), "call-%u", i++); |
97 | call_rdc (call_rdc_cls, strlen (buf) + 1, buf); | 99 | call_rdc (call_rdc_cls, strlen (buf) + 1, buf); |
@@ -134,9 +136,15 @@ play (void *cls, | |||
134 | char buf[32]; | 136 | char buf[32]; |
135 | 137 | ||
136 | if (0 == strcmp (origin, "phone")) | 138 | if (0 == strcmp (origin, "phone")) |
137 | GNUNET_snprintf (buf, sizeof (buf), "call-%u", call_i++); | 139 | GNUNET_snprintf (buf, |
140 | sizeof (buf), | ||
141 | "call-%u", | ||
142 | call_i++); | ||
138 | else | 143 | else |
139 | GNUNET_snprintf (buf, sizeof (buf), "phone-%u", phone_i++); | 144 | GNUNET_snprintf (buf, |
145 | sizeof (buf), | ||
146 | "phone-%u", | ||
147 | phone_i++); | ||
140 | if ( (data_size != strlen (buf) + 1) || | 148 | if ( (data_size != strlen (buf) + 1) || |
141 | (0 != strncmp (buf, data, data_size)) ) | 149 | (0 != strncmp (buf, data, data_size)) ) |
142 | { | 150 | { |
@@ -274,6 +282,7 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = { | |||
274 | static void | 282 | static void |
275 | end_test (void *cls) | 283 | end_test (void *cls) |
276 | { | 284 | { |
285 | (void) cls; | ||
277 | GNUNET_SCHEDULER_shutdown (); | 286 | GNUNET_SCHEDULER_shutdown (); |
278 | if (NULL != op) | 287 | if (NULL != op) |
279 | { | 288 | { |
@@ -313,6 +322,7 @@ static void | |||
313 | caller_event_handler (void *cls, | 322 | caller_event_handler (void *cls, |
314 | enum GNUNET_CONVERSATION_CallerEventCode code) | 323 | enum GNUNET_CONVERSATION_CallerEventCode code) |
315 | { | 324 | { |
325 | (void) cls; | ||
316 | switch (code) | 326 | switch (code) |
317 | { | 327 | { |
318 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: | 328 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: |
@@ -334,6 +344,8 @@ phone_event_handler (void *cls, | |||
334 | static enum GNUNET_CONVERSATION_PhoneEventCode expect | 344 | static enum GNUNET_CONVERSATION_PhoneEventCode expect |
335 | = GNUNET_CONVERSATION_EC_PHONE_RING; | 345 | = GNUNET_CONVERSATION_EC_PHONE_RING; |
336 | 346 | ||
347 | (void) cls; | ||
348 | (void) caller_id; | ||
337 | GNUNET_break (code == expect); | 349 | GNUNET_break (code == expect); |
338 | switch (code) | 350 | switch (code) |
339 | { | 351 | { |
@@ -369,6 +381,7 @@ call_event_handler (void *cls, | |||
369 | static enum GNUNET_CONVERSATION_CallEventCode expect | 381 | static enum GNUNET_CONVERSATION_CallEventCode expect |
370 | = GNUNET_CONVERSATION_EC_CALL_RINGING; | 382 | = GNUNET_CONVERSATION_EC_CALL_RINGING; |
371 | 383 | ||
384 | (void) cls; | ||
372 | GNUNET_break (code == expect); | 385 | GNUNET_break (code == expect); |
373 | switch (code) | 386 | switch (code) |
374 | { | 387 | { |
@@ -405,6 +418,7 @@ static void | |||
405 | caller_ego_create_cont (void *cls, | 418 | caller_ego_create_cont (void *cls, |
406 | const char *emsg) | 419 | const char *emsg) |
407 | { | 420 | { |
421 | (void) cls; | ||
408 | op = NULL; | 422 | op = NULL; |
409 | GNUNET_assert (NULL == emsg); | 423 | GNUNET_assert (NULL == emsg); |
410 | } | 424 | } |
@@ -415,11 +429,15 @@ namestore_put_cont (void *cls, | |||
415 | int32_t success, | 429 | int32_t success, |
416 | const char *emsg) | 430 | const char *emsg) |
417 | { | 431 | { |
432 | (void) cls; | ||
418 | qe = NULL; | 433 | qe = NULL; |
419 | GNUNET_assert (GNUNET_YES == success); | 434 | GNUNET_assert (GNUNET_YES == success); |
420 | GNUNET_assert (NULL == emsg); | 435 | GNUNET_assert (NULL == emsg); |
421 | GNUNET_assert (NULL == op); | 436 | GNUNET_assert (NULL == op); |
422 | op = GNUNET_IDENTITY_create (id, "caller-ego", &caller_ego_create_cont, NULL); | 437 | op = GNUNET_IDENTITY_create (id, |
438 | "caller-ego", | ||
439 | &caller_ego_create_cont, | ||
440 | NULL); | ||
423 | } | 441 | } |
424 | 442 | ||
425 | 443 | ||
@@ -432,6 +450,8 @@ identity_cb (void *cls, | |||
432 | struct GNUNET_GNSRECORD_Data rd; | 450 | struct GNUNET_GNSRECORD_Data rd; |
433 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 451 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
434 | 452 | ||
453 | (void) cls; | ||
454 | (void) ctx; | ||
435 | if (NULL == name) | 455 | if (NULL == name) |
436 | return; | 456 | return; |
437 | if (NULL == ego) | 457 | if (NULL == ego) |
@@ -469,7 +489,6 @@ identity_cb (void *cls, | |||
469 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); | 489 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); |
470 | call = GNUNET_CONVERSATION_call_start (cfg, | 490 | call = GNUNET_CONVERSATION_call_start (cfg, |
471 | ego, | 491 | ego, |
472 | ego, | ||
473 | gns_name, | 492 | gns_name, |
474 | &call_speaker, | 493 | &call_speaker, |
475 | &call_mic, | 494 | &call_mic, |
@@ -484,6 +503,7 @@ static void | |||
484 | phone_ego_create_cont (void *cls, | 503 | phone_ego_create_cont (void *cls, |
485 | const char *emsg) | 504 | const char *emsg) |
486 | { | 505 | { |
506 | (void) cls; | ||
487 | op = NULL; | 507 | op = NULL; |
488 | GNUNET_assert (NULL == emsg); | 508 | GNUNET_assert (NULL == emsg); |
489 | } | 509 | } |
@@ -494,23 +514,33 @@ run (void *cls, | |||
494 | const struct GNUNET_CONFIGURATION_Handle *c, | 514 | const struct GNUNET_CONFIGURATION_Handle *c, |
495 | struct GNUNET_TESTING_Peer *peer) | 515 | struct GNUNET_TESTING_Peer *peer) |
496 | { | 516 | { |
517 | (void) cls; | ||
518 | (void) peer; | ||
497 | cfg = c; | 519 | cfg = c; |
498 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, | 520 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
521 | &end_test, | ||
499 | NULL); | 522 | NULL); |
500 | id = GNUNET_IDENTITY_connect (cfg, | 523 | id = GNUNET_IDENTITY_connect (cfg, |
501 | &identity_cb, | 524 | &identity_cb, |
502 | NULL); | 525 | NULL); |
503 | op = GNUNET_IDENTITY_create (id, "phone-ego", &phone_ego_create_cont, NULL); | 526 | op = GNUNET_IDENTITY_create (id, |
527 | "phone-ego", | ||
528 | &phone_ego_create_cont, | ||
529 | NULL); | ||
504 | ns = GNUNET_NAMESTORE_connect (cfg); | 530 | ns = GNUNET_NAMESTORE_connect (cfg); |
505 | } | 531 | } |
506 | 532 | ||
507 | 533 | ||
508 | int | 534 | int |
509 | main (int argc, char *argv[]) | 535 | main (int argc, |
536 | char *argv[]) | ||
510 | { | 537 | { |
538 | (void) argc; | ||
539 | (void) argv; | ||
511 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api", | 540 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api", |
512 | "test_conversation.conf", | 541 | "test_conversation.conf", |
513 | &run, NULL)) | 542 | &run, |
543 | NULL)) | ||
514 | return 1; | 544 | return 1; |
515 | return ok; | 545 | return ok; |
516 | } | 546 | } |
diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c index 9257764cf..284889e49 100644 --- a/src/conversation/test_conversation_api_reject.c +++ b/src/conversation/test_conversation_api_reject.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013, 2014 GNUnet e.V. | 3 | Copyright (C) 2013, 2014, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -59,6 +59,7 @@ static char *gns_caller_id; | |||
59 | static int | 59 | static int |
60 | enable_speaker (void *cls) | 60 | enable_speaker (void *cls) |
61 | { | 61 | { |
62 | (void) cls; | ||
62 | GNUNET_break (0); | 63 | GNUNET_break (0); |
63 | return GNUNET_SYSERR; | 64 | return GNUNET_SYSERR; |
64 | } | 65 | } |
@@ -67,6 +68,7 @@ enable_speaker (void *cls) | |||
67 | static void | 68 | static void |
68 | disable_speaker (void *cls) | 69 | disable_speaker (void *cls) |
69 | { | 70 | { |
71 | (void) cls; | ||
70 | GNUNET_break (0); | 72 | GNUNET_break (0); |
71 | } | 73 | } |
72 | 74 | ||
@@ -76,6 +78,9 @@ play (void *cls, | |||
76 | size_t data_size, | 78 | size_t data_size, |
77 | const void *data) | 79 | const void *data) |
78 | { | 80 | { |
81 | (void) cls; | ||
82 | (void) data_size; | ||
83 | (void) data; | ||
79 | GNUNET_break (0); | 84 | GNUNET_break (0); |
80 | } | 85 | } |
81 | 86 | ||
@@ -83,6 +88,7 @@ play (void *cls, | |||
83 | static void | 88 | static void |
84 | destroy_speaker (void *cls) | 89 | destroy_speaker (void *cls) |
85 | { | 90 | { |
91 | (void) cls; | ||
86 | } | 92 | } |
87 | 93 | ||
88 | 94 | ||
@@ -100,6 +106,9 @@ enable_mic (void *cls, | |||
100 | GNUNET_MICROPHONE_RecordedDataCallback rdc, | 106 | GNUNET_MICROPHONE_RecordedDataCallback rdc, |
101 | void *rdc_cls) | 107 | void *rdc_cls) |
102 | { | 108 | { |
109 | (void) cls; | ||
110 | (void) rdc; | ||
111 | (void) rdc_cls; | ||
103 | GNUNET_break (0); | 112 | GNUNET_break (0); |
104 | return GNUNET_SYSERR; | 113 | return GNUNET_SYSERR; |
105 | } | 114 | } |
@@ -108,6 +117,7 @@ enable_mic (void *cls, | |||
108 | static void | 117 | static void |
109 | disable_mic (void *cls) | 118 | disable_mic (void *cls) |
110 | { | 119 | { |
120 | (void) cls; | ||
111 | GNUNET_break (0); | 121 | GNUNET_break (0); |
112 | } | 122 | } |
113 | 123 | ||
@@ -115,6 +125,7 @@ disable_mic (void *cls) | |||
115 | static void | 125 | static void |
116 | destroy_mic (void *cls) | 126 | destroy_mic (void *cls) |
117 | { | 127 | { |
128 | (void) cls; | ||
118 | } | 129 | } |
119 | 130 | ||
120 | 131 | ||
@@ -134,6 +145,7 @@ static struct GNUNET_MICROPHONE_Handle call_mic = { | |||
134 | static void | 145 | static void |
135 | end_test (void *cls) | 146 | end_test (void *cls) |
136 | { | 147 | { |
148 | (void) cls; | ||
137 | GNUNET_SCHEDULER_shutdown (); | 149 | GNUNET_SCHEDULER_shutdown (); |
138 | if (NULL != op) | 150 | if (NULL != op) |
139 | { | 151 | { |
@@ -179,6 +191,8 @@ phone_event_handler (void *cls, | |||
179 | static enum GNUNET_CONVERSATION_PhoneEventCode expect | 191 | static enum GNUNET_CONVERSATION_PhoneEventCode expect |
180 | = GNUNET_CONVERSATION_EC_PHONE_RING; | 192 | = GNUNET_CONVERSATION_EC_PHONE_RING; |
181 | 193 | ||
194 | (void) cls; | ||
195 | (void) caller_id; | ||
182 | GNUNET_break (code == expect); | 196 | GNUNET_break (code == expect); |
183 | switch (code) | 197 | switch (code) |
184 | { | 198 | { |
@@ -199,6 +213,7 @@ call_event_handler (void *cls, | |||
199 | static enum GNUNET_CONVERSATION_CallEventCode expect | 213 | static enum GNUNET_CONVERSATION_CallEventCode expect |
200 | = GNUNET_CONVERSATION_EC_CALL_RINGING; | 214 | = GNUNET_CONVERSATION_EC_CALL_RINGING; |
201 | 215 | ||
216 | (void) cls; | ||
202 | GNUNET_break (code == expect); | 217 | GNUNET_break (code == expect); |
203 | switch (code) | 218 | switch (code) |
204 | { | 219 | { |
@@ -229,6 +244,7 @@ static void | |||
229 | caller_ego_create_cont (void *cls, | 244 | caller_ego_create_cont (void *cls, |
230 | const char *emsg) | 245 | const char *emsg) |
231 | { | 246 | { |
247 | (void) cls; | ||
232 | op = NULL; | 248 | op = NULL; |
233 | GNUNET_assert (NULL == emsg); | 249 | GNUNET_assert (NULL == emsg); |
234 | } | 250 | } |
@@ -239,12 +255,15 @@ namestore_put_cont (void *cls, | |||
239 | int32_t success, | 255 | int32_t success, |
240 | const char *emsg) | 256 | const char *emsg) |
241 | { | 257 | { |
258 | (void) cls; | ||
242 | qe = NULL; | 259 | qe = NULL; |
243 | GNUNET_assert (GNUNET_YES == success); | 260 | GNUNET_assert (GNUNET_YES == success); |
244 | GNUNET_assert (NULL == emsg); | 261 | GNUNET_assert (NULL == emsg); |
245 | GNUNET_assert (NULL == op); | 262 | GNUNET_assert (NULL == op); |
246 | op = GNUNET_IDENTITY_create (id, "caller-ego", | 263 | op = GNUNET_IDENTITY_create (id, |
247 | &caller_ego_create_cont, NULL); | 264 | "caller-ego", |
265 | &caller_ego_create_cont, | ||
266 | NULL); | ||
248 | } | 267 | } |
249 | 268 | ||
250 | 269 | ||
@@ -257,6 +276,8 @@ identity_cb (void *cls, | |||
257 | struct GNUNET_GNSRECORD_Data rd; | 276 | struct GNUNET_GNSRECORD_Data rd; |
258 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 277 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
259 | 278 | ||
279 | (void) cls; | ||
280 | (void) ctx; | ||
260 | if (NULL == name) | 281 | if (NULL == name) |
261 | return; | 282 | return; |
262 | if (NULL == ego) | 283 | if (NULL == ego) |
@@ -294,7 +315,6 @@ identity_cb (void *cls, | |||
294 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); | 315 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); |
295 | call = GNUNET_CONVERSATION_call_start (cfg, | 316 | call = GNUNET_CONVERSATION_call_start (cfg, |
296 | ego, | 317 | ego, |
297 | ego, | ||
298 | gns_name, | 318 | gns_name, |
299 | &call_speaker, | 319 | &call_speaker, |
300 | &call_mic, | 320 | &call_mic, |
@@ -309,6 +329,7 @@ static void | |||
309 | phone_ego_create_cont (void *cls, | 329 | phone_ego_create_cont (void *cls, |
310 | const char *emsg) | 330 | const char *emsg) |
311 | { | 331 | { |
332 | (void) cls; | ||
312 | op = NULL; | 333 | op = NULL; |
313 | GNUNET_assert (NULL == emsg); | 334 | GNUNET_assert (NULL == emsg); |
314 | } | 335 | } |
@@ -319,13 +340,18 @@ run (void *cls, | |||
319 | const struct GNUNET_CONFIGURATION_Handle *c, | 340 | const struct GNUNET_CONFIGURATION_Handle *c, |
320 | struct GNUNET_TESTING_Peer *peer) | 341 | struct GNUNET_TESTING_Peer *peer) |
321 | { | 342 | { |
343 | (void) cls; | ||
344 | (void) peer; | ||
322 | cfg = c; | 345 | cfg = c; |
323 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, | 346 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, |
324 | NULL); | 347 | NULL); |
325 | id = GNUNET_IDENTITY_connect (cfg, | 348 | id = GNUNET_IDENTITY_connect (cfg, |
326 | &identity_cb, | 349 | &identity_cb, |
327 | NULL); | 350 | NULL); |
328 | op = GNUNET_IDENTITY_create (id, "phone-ego", &phone_ego_create_cont, NULL); | 351 | op = GNUNET_IDENTITY_create (id, |
352 | "phone-ego", | ||
353 | &phone_ego_create_cont, | ||
354 | NULL); | ||
329 | ns = GNUNET_NAMESTORE_connect (cfg); | 355 | ns = GNUNET_NAMESTORE_connect (cfg); |
330 | } | 356 | } |
331 | 357 | ||
@@ -333,6 +359,8 @@ run (void *cls, | |||
333 | int | 359 | int |
334 | main (int argc, char *argv[]) | 360 | main (int argc, char *argv[]) |
335 | { | 361 | { |
362 | (void) argc; | ||
363 | (void) argv; | ||
336 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api", | 364 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api", |
337 | "test_conversation.conf", | 365 | "test_conversation.conf", |
338 | &run, NULL)) | 366 | &run, NULL)) |
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c index 7d2705e70..ac3a87fad 100644 --- a/src/conversation/test_conversation_api_twocalls.c +++ b/src/conversation/test_conversation_api_twocalls.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2013 GNUnet e.V. | 3 | Copyright (C) 2013, 2018x GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -130,11 +130,15 @@ phone_send (void *cls) | |||
130 | { | 130 | { |
131 | char buf[32]; | 131 | char buf[32]; |
132 | 132 | ||
133 | (void) cls; | ||
133 | GNUNET_assert (NULL != phone_rdc); | 134 | GNUNET_assert (NULL != phone_rdc); |
134 | GNUNET_snprintf (buf, sizeof (buf), "phone"); | 135 | GNUNET_snprintf (buf, sizeof (buf), "phone"); |
135 | phone_rdc (phone_rdc_cls, strlen (buf) + 1, buf); | 136 | phone_rdc (phone_rdc_cls, |
137 | strlen (buf) + 1, | ||
138 | buf); | ||
136 | phone_task = GNUNET_SCHEDULER_add_delayed (FREQ, | 139 | phone_task = GNUNET_SCHEDULER_add_delayed (FREQ, |
137 | &phone_send, NULL); | 140 | &phone_send, |
141 | NULL); | ||
138 | } | 142 | } |
139 | 143 | ||
140 | 144 | ||
@@ -144,11 +148,17 @@ call_send (void *cls) | |||
144 | struct MicContext *mc = cls; | 148 | struct MicContext *mc = cls; |
145 | char buf[32]; | 149 | char buf[32]; |
146 | 150 | ||
151 | (void) cls; | ||
147 | GNUNET_assert (NULL != mc->rdc); | 152 | GNUNET_assert (NULL != mc->rdc); |
148 | GNUNET_snprintf (buf, sizeof (buf), "call"); | 153 | GNUNET_snprintf (buf, |
149 | mc->rdc (mc->rdc_cls, strlen (buf) + 1, buf); | 154 | sizeof (buf), |
155 | "call"); | ||
156 | mc->rdc (mc->rdc_cls, | ||
157 | strlen (buf) + 1, | ||
158 | buf); | ||
150 | mc->call_task = GNUNET_SCHEDULER_add_delayed (FREQ, | 159 | mc->call_task = GNUNET_SCHEDULER_add_delayed (FREQ, |
151 | &call_send, mc); | 160 | &call_send, |
161 | mc); | ||
152 | } | 162 | } |
153 | 163 | ||
154 | 164 | ||
@@ -157,6 +167,7 @@ enable_speaker (void *cls) | |||
157 | { | 167 | { |
158 | const char *origin = CLS_STR (cls); | 168 | const char *origin = CLS_STR (cls); |
159 | 169 | ||
170 | (void) cls; | ||
160 | LOG_DEBUG ("Speaker %s enabled\n", | 171 | LOG_DEBUG ("Speaker %s enabled\n", |
161 | origin); | 172 | origin); |
162 | return GNUNET_OK; | 173 | return GNUNET_OK; |
@@ -168,6 +179,7 @@ disable_speaker (void *cls) | |||
168 | { | 179 | { |
169 | const char *origin = CLS_STR (cls); | 180 | const char *origin = CLS_STR (cls); |
170 | 181 | ||
182 | (void) cls; | ||
171 | LOG_DEBUG ("Speaker %s disabled\n", | 183 | LOG_DEBUG ("Speaker %s disabled\n", |
172 | origin); | 184 | origin); |
173 | } | 185 | } |
@@ -181,6 +193,7 @@ play (void *cls, | |||
181 | static unsigned int phone_i; | 193 | static unsigned int phone_i; |
182 | static unsigned int call_i; | 194 | static unsigned int call_i; |
183 | 195 | ||
196 | (void) cls; | ||
184 | if (0 == strncmp ("call", data, data_size)) | 197 | if (0 == strncmp ("call", data, data_size)) |
185 | call_i++; | 198 | call_i++; |
186 | else if (0 == strncmp ("phone", data, data_size)) | 199 | else if (0 == strncmp ("phone", data, data_size)) |
@@ -348,6 +361,7 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = { | |||
348 | static void | 361 | static void |
349 | end_test (void *cls) | 362 | end_test (void *cls) |
350 | { | 363 | { |
364 | (void) cls; | ||
351 | timeout_task = NULL; | 365 | timeout_task = NULL; |
352 | fprintf (stderr, | 366 | fprintf (stderr, |
353 | "Timeout!\n"); | 367 | "Timeout!\n"); |
@@ -363,6 +377,7 @@ end_test (void *cls) | |||
363 | static void | 377 | static void |
364 | do_shutdown (void *cls) | 378 | do_shutdown (void *cls) |
365 | { | 379 | { |
380 | (void) cls; | ||
366 | if (NULL != timeout_task) | 381 | if (NULL != timeout_task) |
367 | { | 382 | { |
368 | GNUNET_SCHEDULER_cancel (timeout_task); | 383 | GNUNET_SCHEDULER_cancel (timeout_task); |
@@ -411,11 +426,14 @@ static void | |||
411 | caller_event_handler (void *cls, | 426 | caller_event_handler (void *cls, |
412 | enum GNUNET_CONVERSATION_CallerEventCode code) | 427 | enum GNUNET_CONVERSATION_CallerEventCode code) |
413 | { | 428 | { |
429 | (void) cls; | ||
414 | switch (code) | 430 | switch (code) |
415 | { | 431 | { |
416 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: | 432 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: |
417 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: | 433 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: |
418 | LOG (GNUNET_ERROR_TYPE_WARNING, "Unexpected caller code: %d\n", code); | 434 | LOG (GNUNET_ERROR_TYPE_WARNING, |
435 | "Unexpected caller code: %d\n", | ||
436 | code); | ||
419 | break; | 437 | break; |
420 | } | 438 | } |
421 | } | 439 | } |
@@ -428,6 +446,8 @@ phone_event_handler (void *cls, | |||
428 | const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id) | 446 | const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id) |
429 | { | 447 | { |
430 | const char *cid; | 448 | const char *cid; |
449 | (void) cls; | ||
450 | (void) caller_id; | ||
431 | 451 | ||
432 | switch (code) | 452 | switch (code) |
433 | { | 453 | { |
@@ -470,7 +490,9 @@ phone_event_handler (void *cls, | |||
470 | } | 490 | } |
471 | break; | 491 | break; |
472 | default: | 492 | default: |
473 | LOG (GNUNET_ERROR_TYPE_WARNING, "Unexpected phone code: %d\n", code); | 493 | LOG (GNUNET_ERROR_TYPE_WARNING, |
494 | "Unexpected phone code: %d\n", | ||
495 | code); | ||
474 | break; | 496 | break; |
475 | } | 497 | } |
476 | } | 498 | } |
@@ -521,6 +543,7 @@ static void | |||
521 | caller_ego_create_cont (void *cls, | 543 | caller_ego_create_cont (void *cls, |
522 | const char *emsg) | 544 | const char *emsg) |
523 | { | 545 | { |
546 | (void) cls; | ||
524 | op = NULL; | 547 | op = NULL; |
525 | GNUNET_assert (NULL == emsg); | 548 | GNUNET_assert (NULL == emsg); |
526 | } | 549 | } |
@@ -531,11 +554,15 @@ namestore_put_cont (void *cls, | |||
531 | int32_t success, | 554 | int32_t success, |
532 | const char *emsg) | 555 | const char *emsg) |
533 | { | 556 | { |
557 | (void) cls; | ||
534 | qe = NULL; | 558 | qe = NULL; |
535 | GNUNET_assert (GNUNET_YES == success); | 559 | GNUNET_assert (GNUNET_YES == success); |
536 | GNUNET_assert (NULL == emsg); | 560 | GNUNET_assert (NULL == emsg); |
537 | GNUNET_assert (NULL == op); | 561 | GNUNET_assert (NULL == op); |
538 | op = GNUNET_IDENTITY_create (id, "caller-ego", &caller_ego_create_cont, NULL); | 562 | op = GNUNET_IDENTITY_create (id, |
563 | "caller-ego", | ||
564 | &caller_ego_create_cont, | ||
565 | NULL); | ||
539 | } | 566 | } |
540 | 567 | ||
541 | 568 | ||
@@ -548,6 +575,8 @@ identity_cb (void *cls, | |||
548 | struct GNUNET_GNSRECORD_Data rd; | 575 | struct GNUNET_GNSRECORD_Data rd; |
549 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 576 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
550 | 577 | ||
578 | (void) cls; | ||
579 | (void) ctx; | ||
551 | if (NULL == name) | 580 | if (NULL == name) |
552 | return; | 581 | return; |
553 | if (NULL == ego) | 582 | if (NULL == ego) |
@@ -585,7 +614,6 @@ identity_cb (void *cls, | |||
585 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); | 614 | GNUNET_GNSRECORD_pkey_to_zkey (&pub)); |
586 | call1 = GNUNET_CONVERSATION_call_start (cfg, | 615 | call1 = GNUNET_CONVERSATION_call_start (cfg, |
587 | ego, | 616 | ego, |
588 | ego, | ||
589 | gns_name, | 617 | gns_name, |
590 | &call1_speaker, | 618 | &call1_speaker, |
591 | &call1_mic, | 619 | &call1_mic, |
@@ -593,7 +621,6 @@ identity_cb (void *cls, | |||
593 | (void *) "call1"); | 621 | (void *) "call1"); |
594 | call2 = GNUNET_CONVERSATION_call_start (cfg, | 622 | call2 = GNUNET_CONVERSATION_call_start (cfg, |
595 | ego, | 623 | ego, |
596 | ego, | ||
597 | gns_name, | 624 | gns_name, |
598 | &call2_speaker, | 625 | &call2_speaker, |
599 | &call2_mic, | 626 | &call2_mic, |
@@ -608,6 +635,7 @@ static void | |||
608 | phone_ego_create_cont (void *cls, | 635 | phone_ego_create_cont (void *cls, |
609 | const char *emsg) | 636 | const char *emsg) |
610 | { | 637 | { |
638 | (void) cls; | ||
611 | op = NULL; | 639 | op = NULL; |
612 | GNUNET_assert (NULL == emsg); | 640 | GNUNET_assert (NULL == emsg); |
613 | } | 641 | } |
@@ -618,6 +646,8 @@ run (void *cls, | |||
618 | const struct GNUNET_CONFIGURATION_Handle *c, | 646 | const struct GNUNET_CONFIGURATION_Handle *c, |
619 | struct GNUNET_TESTING_Peer *peer) | 647 | struct GNUNET_TESTING_Peer *peer) |
620 | { | 648 | { |
649 | (void) cls; | ||
650 | (void) peer; | ||
621 | cfg = c; | 651 | cfg = c; |
622 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 652 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
623 | &end_test, | 653 | &end_test, |
@@ -627,18 +657,24 @@ run (void *cls, | |||
627 | id = GNUNET_IDENTITY_connect (cfg, | 657 | id = GNUNET_IDENTITY_connect (cfg, |
628 | &identity_cb, | 658 | &identity_cb, |
629 | NULL); | 659 | NULL); |
630 | op = GNUNET_IDENTITY_create (id, "phone-ego", &phone_ego_create_cont, NULL); | 660 | op = GNUNET_IDENTITY_create (id, |
661 | "phone-ego", | ||
662 | &phone_ego_create_cont, | ||
663 | NULL); | ||
631 | ns = GNUNET_NAMESTORE_connect (cfg); | 664 | ns = GNUNET_NAMESTORE_connect (cfg); |
632 | } | 665 | } |
633 | 666 | ||
634 | 667 | ||
635 | int | 668 | int |
636 | main (int argc, char *argv[]) | 669 | main (int argc, |
670 | char *argv[]) | ||
637 | { | 671 | { |
638 | 672 | (void) argc; | |
673 | (void) argv; | ||
639 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api_twocalls", | 674 | if (0 != GNUNET_TESTING_peer_run ("test_conversation_api_twocalls", |
640 | "test_conversation.conf", | 675 | "test_conversation.conf", |
641 | &run, NULL)) | 676 | &run, |
677 | NULL)) | ||
642 | return 1; | 678 | return 1; |
643 | if (call1_finished && call2_finished) | 679 | if (call1_finished && call2_finished) |
644 | return 0; | 680 | return 0; |