cleaning
authorChristian Grothoff <christian@grothoff.org>
Sat, 7 May 2011 08:07:08 +0000 (08:07 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 7 May 2011 08:07:08 +0000 (08:07 +0000)
src/transport/test_plugin_transport_http.c
src/transport/test_plugin_transport_https.c
src/transport/test_quota_compliance.c

index 3c127a9505102d71c3ce5a1611f06125eea4aedd..4ab52cf58d8049d01f3cab8034a864a98dd0d538 100644 (file)
@@ -392,7 +392,6 @@ static GNUNET_SCHEDULER_TaskIdentifier http_task_send;
 static void
 shutdown_clean ()
 {
-  struct Plugin_Address * cur;
   struct Plugin_Address * tmp;
 
   /* Evaluate results  */
@@ -432,7 +431,6 @@ shutdown_clean ()
   /* cleaning addresses */
   while (addr_head != NULL)
   {
-    cur = addr_head;
     tmp = addr_head->next;
     GNUNET_free (addr_head->addr);
     GNUNET_free (addr_head);
@@ -481,9 +479,6 @@ static void task_send_cont (void *cls,
                             const struct GNUNET_PeerIdentity * target,
                             int result)
 {
-  struct Plugin_Address * tmp_addr;
-  tmp_addr = addr_head;
-
   if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n");
@@ -1195,13 +1190,13 @@ run (void *cls,
 
   /* assertions before start */
   GNUNET_assert ((port > 0) && (port <= 65535));
-  GNUNET_assert(&my_public_key != NULL);
-  GNUNET_assert(&my_identity.hashPubKey != NULL);
 
   /* load plugins... */
   setup_plugin_environment ();
   GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http");
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading HTTP transport plugin `%s'\n"),libname);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, 
+             _("Loading HTTP transport plugin `%s'\n"),
+             libname);
   api = GNUNET_PLUGIN_load (libname, &env);
   GNUNET_free (libname);
   if (api == NULL)
@@ -1217,14 +1212,17 @@ run (void *cls,
 
   /* testing plugin functionality */
   GNUNET_assert (0!=fail_notify_address_count);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport plugin returned %u addresses to connect to\n",  fail_notify_address_count);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Transport plugin returned %u addresses to connect to\n", 
+             fail_notify_address_count);
 
   /* testing pretty printer with all addresses obtained from the plugin*/
   cur = addr_head;
   while (cur != NULL)
   {
-
-    api->address_pretty_printer (api->cls, "http",cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, &pretty_printer_cb,NULL);
+    api->address_pretty_printer (api->cls, "http",
+                                cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, 
+                                &pretty_printer_cb, NULL);
     addr_str = api->address_to_string (api->cls, cur->addr, cur->addrlen);
     suggest_res = api->check_address (api->cls, cur->addr, cur->addrlen);
 
@@ -1337,7 +1335,8 @@ main (int argc, char *const *argv)
                              "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES;
 
   GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin_http");
-
+  if (ret != GNUNET_OK)
+    return 1;
   return fail;
 }
 
index 61aea1fa717c38698700b51ca59e8120976d8aa8..12371a1621fe93b9a507c7e768bba727f92339a2 100644 (file)
@@ -18,8 +18,8 @@
      Boston, MA 02111-1307, USA.
 */
 /**
- * @file transport/test_gnunet_transport_plugin.https.c
- * @brief testcase for gnunet_transport_plugin.https.c
+ * @file transport/test_plugin_transport_https.c
+ * @brief testcase for plugin_transport_https.c
  * @author Matthias Wachs
  */
 
@@ -395,7 +395,6 @@ static char * cert_file;
 static void
 shutdown_clean ()
 {
-  struct Plugin_Address * cur;
   struct Plugin_Address * tmp;
 
   /* Evaluate results  */
@@ -435,7 +434,6 @@ shutdown_clean ()
   /* cleaning addresses */
   while (addr_head != NULL)
   {
-    cur = addr_head;
     tmp = addr_head->next;
     GNUNET_free (addr_head->addr);
     GNUNET_free (addr_head);
@@ -504,9 +502,6 @@ static void task_send_cont (void *cls,
                             const struct GNUNET_PeerIdentity * target,
                             int result)
 {
-  struct Plugin_Address * tmp_addr;
-  tmp_addr = addr_head;
-
   if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n");
@@ -1261,8 +1256,6 @@ run (void *cls,
 
   /* assertions before start */
   GNUNET_assert ((port > 0) && (port <= 65535));
-  GNUNET_assert(&my_public_key != NULL);
-  GNUNET_assert(&my_identity.hashPubKey != NULL);
 
   /* load plugins... */
   setup_plugin_environment ();
@@ -1401,9 +1394,10 @@ main (int argc, char *const *argv)
                              "test_gnunet_transport_plugin.https",
                              "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES;
 
-    GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https");
-
+  GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https");
+  if (GNUNET_OK != ret)
+    return 1;
   return fail;
 }
 
-/* end of test_gnunet_transport_plugin.http.c */
+/* end of test_plugin_transport_https.c */
index 219971725578acc47f2ec042c5019f49ef73da5a..d8ac5eab3a19464bc7f17a84dba0e93ddd2101f2 100644 (file)
@@ -236,7 +236,7 @@ struct TestMessage
 };
 
 static unsigned int
-get_size (void)
+get_size ()
 {
   return MEASUREMENT_MSG_SIZE + sizeof (struct TestMessage);
 }
@@ -247,11 +247,9 @@ notify_receive_new (void *cls,
                 const struct GNUNET_MessageHeader *message,
                 const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count)
 {
-  unsigned int s;
   const struct TestMessage *hdr;
 
   hdr = (const struct TestMessage*) message;
-  s = get_size ();
   if (measurement_running == GNUNET_NO)
          return;
   if (MTYPE != ntohs (message->type))