-fix build system issues
[oweals/gnunet.git] / src / conversation / test_conversation_api.c
index d8c10c2bfd879a1f35c5c680fd558ba1a1cef379..9714d5a81bce2b3cc471da42f3b888640a9f3f5e 100644 (file)
@@ -23,8 +23,7 @@
  *
  * This test performs the operations of a call to a phone
  * where the phone user picks up and then the call is
- * terminated by the party that initiated the call.  The
- * actual transmission of voice data is not tested.
+ * terminated by the party that initiated the call.
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
@@ -132,14 +131,14 @@ play (void *cls,
       const void *data)
 {
   const char *origin = cls;
-  static unsigned int phone_i;
+  static unsigned int phone_i = 1;
   static unsigned int call_i;
   char buf[32];
 
   if (0 == strcmp (origin, "phone"))
-    GNUNET_snprintf (buf, sizeof (buf), "phone-%u", phone_i++);
-  else
     GNUNET_snprintf (buf, sizeof (buf), "call-%u", call_i++);
+  else
+    GNUNET_snprintf (buf, sizeof (buf), "phone-%u", phone_i++);
   if ( (data_size != strlen (buf) + 1) ||
        (0 != strncmp (buf, data, data_size)) )
   {
@@ -149,8 +148,13 @@ play (void *cls,
              (int) data_size,
              (const char *) data);
   }
+  else
+  {
+    fprintf (stderr, ".");
+  }
   if ( (20 < call_i) &&
-       (20 < phone_i) )
+       (20 < phone_i) &&
+       (NULL != call) )
   {
     /* time to hang up ... */
     GNUNET_CONVERSATION_call_stop (call);
@@ -381,6 +385,7 @@ call_event_handler (void *cls,
     break;
   case GNUNET_CONVERSATION_EC_CALL_SUSPENDED:
   case GNUNET_CONVERSATION_EC_CALL_RESUMED:
+  case GNUNET_CONVERSATION_EC_CALL_ERROR:
     fprintf (stderr, "Unexpected call code: %d\n", code);
     break;
   }