summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-07 08:07:08 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-07 08:07:08 +0000
commit697f3378a6f233b1453225fd378032d64f8c4fbe (patch)
tree17c85962d4ac58cb414b2627964f69d20bd29dd7 /src
parent0fbc618f3e34eb438459556d2c2f80b5b9860fd7 (diff)
cleaning
Diffstat (limited to 'src')
-rw-r--r--src/transport/test_plugin_transport_http.c23
-rw-r--r--src/transport/test_plugin_transport_https.c18
-rw-r--r--src/transport/test_quota_compliance.c4
3 files changed, 18 insertions, 27 deletions
diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c
index 3c127a950..4ab52cf58 100644
--- a/src/transport/test_plugin_transport_http.c
+++ b/src/transport/test_plugin_transport_http.c
@@ -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;
}
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c
index 61aea1fa7..12371a162 100644
--- a/src/transport/test_plugin_transport_https.c
+++ b/src/transport/test_plugin_transport_https.c
@@ -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 */
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 219971725..d8ac5eab3 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -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))