aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/test_conversation_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-03-30 16:23:29 +0200
committerChristian Grothoff <christian@grothoff.org>2018-03-30 16:23:29 +0200
commitb7513a90c350bc3f768c3b1e7a42228f272314dd (patch)
tree470c89c4204905fdcba9e859a468790295d3fd26 /src/conversation/test_conversation_api.c
parent7075d32a5bd56a95797b1113e4cf5638c14ca8fc (diff)
downloadgnunet-b7513a90c350bc3f768c3b1e7a42228f272314dd.tar.gz
gnunet-b7513a90c350bc3f768c3b1e7a42228f272314dd.zip
fix conversation ftbfs issues:
Diffstat (limited to 'src/conversation/test_conversation_api.c')
-rw-r--r--src/conversation/test_conversation_api.c48
1 files changed, 39 insertions, 9 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 = {
274static void 282static void
275end_test (void *cls) 283end_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
313caller_event_handler (void *cls, 322caller_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
405caller_ego_create_cont (void *cls, 418caller_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
484phone_ego_create_cont (void *cls, 503phone_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
508int 534int
509main (int argc, char *argv[]) 535main (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}