[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22096 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22096 - gnunet/src/ats |
Date: |
Tue, 19 Jun 2012 10:02:12 +0200 |
Author: wachs
Date: 2012-06-19 10:02:12 +0200 (Tue, 19 Jun 2012)
New Revision: 22096
Modified:
gnunet/src/ats/test_ats_api_scheduling.c
gnunet/src/ats/test_ats_api_scheduling_destroy_address.c
Log:
- cleanup
Modified: gnunet/src/ats/test_ats_api_scheduling.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling.c 2012-06-19 07:57:02 UTC (rev
22095)
+++ gnunet/src/ats/test_ats_api_scheduling.c 2012-06-19 08:02:12 UTC (rev
22096)
@@ -67,7 +67,7 @@
struct Address *addr;
};
-struct Address addr[2];
+struct Address test_addr[2];
struct PeerContext p[2];
struct GNUNET_ATS_Information atsi[2];
@@ -127,12 +127,12 @@
GNUNET_assert (0 ==
memcmp (&address->peer, &p[0].id,
sizeof (struct GNUNET_PeerIdentity)));
- GNUNET_assert (0 == strcmp (address->transport_name, addr[0].plugin));
- GNUNET_assert (address->address_length == addr[0].addr_len);
+ GNUNET_assert (0 == strcmp (address->transport_name, test_addr[0].plugin));
+ GNUNET_assert (address->address_length == test_addr[0].addr_len);
GNUNET_assert (0 ==
- memcmp (address->address, addr[0].plugin,
+ memcmp (address->address, test_addr[0].plugin,
address->address_length));
- GNUNET_assert (addr[0].session == session);
+ GNUNET_assert (test_addr[0].session == session);
ret = 0;
@@ -179,26 +179,26 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created peer `%s'\n",
GNUNET_i2s (&p[1].id));
- addr[0].plugin = "test";
- addr[0].session = NULL;
- addr[0].addr = GNUNET_strdup ("test");
- addr[0].addr_len = 4;
+ test_addr[0].plugin = "test";
+ test_addr[0].session = NULL;
+ test_addr[0].addr = GNUNET_strdup ("test");
+ test_addr[0].addr_len = 4;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing address creation\n");
address0.peer = p[0].id;
- address0.transport_name = addr[0].plugin;
- address0.address = addr[0].addr;
- address0.address_length = addr[0].addr_len;
- GNUNET_ATS_address_add (ats, &address0, addr[0].session, NULL, 0);
- GNUNET_ATS_address_update (ats, &address0, addr[0].session, NULL, 0);
+ address0.transport_name = test_addr[0].plugin;
+ address0.address = test_addr[0].addr;
+ address0.address_length = test_addr[0].addr_len;
+ GNUNET_ATS_address_add (ats, &address0, test_addr[0].session, NULL, 0);
+ GNUNET_ATS_address_update (ats, &address0, test_addr[0].session, NULL, 0);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info creation\n");
atsi[0].type = htonl (GNUNET_ATS_UTILIZATION_UP);
atsi[0].value = htonl (1024);
- GNUNET_ATS_address_update (ats, &address0, addr[0].session, atsi, 1);
+ GNUNET_ATS_address_update (ats, &address0, test_addr[0].session, atsi, 1);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing ATS info update\n");
@@ -208,7 +208,7 @@
atsi[1].type = htonl (GNUNET_ATS_UTILIZATION_DOWN);
atsi[1].value = htonl (1024);
- GNUNET_ATS_address_update (ats, &address0, addr[0].session, atsi, 2);
+ GNUNET_ATS_address_update (ats, &address0, test_addr[0].session, atsi, 2);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Requesting peer `%s'\n",
GNUNET_i2s (&p[0].id));
Modified: gnunet/src/ats/test_ats_api_scheduling_destroy_address.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_destroy_address.c 2012-06-19
07:57:02 UTC (rev 22095)
+++ gnunet/src/ats/test_ats_api_scheduling_destroy_address.c 2012-06-19
08:02:12 UTC (rev 22096)
@@ -62,10 +62,10 @@
struct Address *addr;
};
-struct Address addr;
+struct Address test_addr;
struct PeerContext p;
struct GNUNET_ATS_Information atsi;
-struct GNUNET_HELLO_Address address0;
+struct GNUNET_HELLO_Address hello_address;
static void
stop_arm ()
@@ -130,25 +130,25 @@
GNUNET_assert (0 ==
memcmp (&address->peer, &p.id,
sizeof (struct GNUNET_PeerIdentity)));
- GNUNET_assert (0 == strcmp (address->transport_name, addr.plugin));
- GNUNET_assert (address->address_length == addr.addr_len);
+ GNUNET_assert (0 == strcmp (address->transport_name, test_addr.plugin));
+ GNUNET_assert (address->address_length == test_addr.addr_len);
GNUNET_assert (0 ==
- memcmp (address->address, addr.plugin,
+ memcmp (address->address, test_addr.plugin,
address->address_length));
- GNUNET_assert (addr.session == session);
+ GNUNET_assert (test_addr.session == session);
if (0 == stage)
{
/* Delete session */
- GNUNET_ATS_address_destroyed (ats, &address0, addr.session);
- addr.session = NULL;
+ GNUNET_ATS_address_destroyed (ats, &hello_address, test_addr.session);
+ test_addr.session = NULL;
GNUNET_ATS_suggest_address (ats, &p.id);
}
if (1 == stage)
{
/* Delete address */
- GNUNET_ATS_address_destroyed (ats, &address0, addr.session);
- addr.session = NULL;
+ GNUNET_ATS_address_destroyed (ats, &hello_address, test_addr.session);
+ test_addr.session = NULL;
GNUNET_ATS_suggest_address (ats, &p.id);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL);
}
@@ -188,17 +188,17 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created peer `%s'\n",
GNUNET_i2s (&p.id));
- addr.plugin = "test";
- addr.session = &addr;
- addr.addr = GNUNET_strdup ("test");
- addr.addr_len = 4;
+ test_addr.plugin = "test";
+ test_addr.session = &test_addr;
+ test_addr.addr = GNUNET_strdup ("test");
+ test_addr.addr_len = 4;
/* Adding address with session */
- address0.peer = p.id;
- address0.transport_name = addr.plugin;
- address0.address = addr.addr;
- address0.address_length = addr.addr_len;
- GNUNET_ATS_address_add (ats, &address0, addr.session, NULL, 0);
+ hello_address.peer = p.id;
+ hello_address.transport_name = test_addr.plugin;
+ hello_address.address = test_addr.addr;
+ hello_address.address_length = test_addr.addr_len;
+ GNUNET_ATS_address_add (ats, &hello_address, test_addr.session, NULL, 0);
GNUNET_ATS_suggest_address (ats, &p.id);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22096 - gnunet/src/ats,
gnunet <=