fix more leaks
[oweals/gnunet.git] / src / transport / test_transport_api_unreliability.c
index f1e249cdb6bfe14ebb63a4f6504ed7e1e96c181a..9bae154de923f91d0e34bfd631f8adc399da4d21 100644 (file)
@@ -131,11 +131,11 @@ end ()
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
 
-  delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
+  delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
   FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
-           total_bytes * 1000 / 1024 / delta);
+           total_bytes * 1024 / delta);
   GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin);
-  GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta),
+  GAUGER ("TRANSPORT", value_name, (int) (total_bytes / 1024 / delta),
           "kb/s");
   GNUNET_free (value_name);
 
@@ -191,6 +191,16 @@ end_badly ()
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Test had timeout while waiting to send data\n");
 
+  int i;
+
+  for (i = 0; i < TOTAL_MSGS; i++)
+  {
+    if (get_bit (bitmap, i) == 0)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not receive message %d\n", i);
+      ok = -1;
+    }
+  }
 
   if (th != NULL)
     GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
@@ -274,8 +284,7 @@ get_bit (const char *map, unsigned int bit)
 
 static void
 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+                const struct GNUNET_MessageHeader *message)
 {
   static int n;
 
@@ -424,8 +433,7 @@ notify_ready (void *cls, size_t size, void *buf)
 
 
 static void
-notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
 {
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
@@ -447,7 +455,7 @@ static void
 sendtask ()
 {
   start_time = GNUNET_TIME_absolute_get ();
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Starting to send %u messages\n",
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting to send %u messages\n",
               TOTAL_MSGS);
   th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0), 0,
                                                TIMEOUT_TRANSMIT, &notify_ready,