aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-06-19 08:02:41 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-06-19 08:02:41 +0000
commit92ab0a2e11b3b3c5dec664383370d0dab3c30974 (patch)
treeddf68c16756d5c6d7bfa7d30fc4ae1a9b55b2210 /src/ats
parenteb62118a1defb01f9633a8d15a342023b9246732 (diff)
downloadgnunet-92ab0a2e11b3b3c5dec664383370d0dab3c30974.tar.gz
gnunet-92ab0a2e11b3b3c5dec664383370d0dab3c30974.zip
- cleanup
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/test_ats_api_scheduling_add_address.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/ats/test_ats_api_scheduling_add_address.c b/src/ats/test_ats_api_scheduling_add_address.c
index f3f0f55a7..587515df3 100644
--- a/src/ats/test_ats_api_scheduling_add_address.c
+++ b/src/ats/test_ats_api_scheduling_add_address.c
@@ -60,7 +60,7 @@ struct PeerContext
60 struct Address *addr; 60 struct Address *addr;
61}; 61};
62 62
63struct Address addr; 63struct Address test_addr;
64struct PeerContext p; 64struct PeerContext p;
65struct GNUNET_ATS_Information atsi; 65struct GNUNET_ATS_Information atsi;
66 66
@@ -120,12 +120,12 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address,
120 GNUNET_assert (0 == 120 GNUNET_assert (0 ==
121 memcmp (&address->peer, &p.id, 121 memcmp (&address->peer, &p.id,
122 sizeof (struct GNUNET_PeerIdentity))); 122 sizeof (struct GNUNET_PeerIdentity)));
123 GNUNET_assert (0 == strcmp (address->transport_name, addr.plugin)); 123 GNUNET_assert (0 == strcmp (address->transport_name, test_addr.plugin));
124 GNUNET_assert (address->address_length == addr.addr_len); 124 GNUNET_assert (address->address_length == test_addr.addr_len);
125 GNUNET_assert (0 == 125 GNUNET_assert (0 ==
126 memcmp (address->address, addr.plugin, 126 memcmp (address->address, test_addr.plugin,
127 address->address_length)); 127 address->address_length));
128 GNUNET_assert (addr.session == session); 128 GNUNET_assert (test_addr.session == session);
129 129
130 ret = 0; 130 ret = 0;
131 131
@@ -167,27 +167,27 @@ check (void *cls, char *const *args, const char *cfgfile,
167 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created peer `%s'\n", 167 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created peer `%s'\n",
168 GNUNET_i2s (&p.id)); 168 GNUNET_i2s (&p.id));
169 169
170 addr.plugin = "test"; 170 test_addr.plugin = "test";
171 addr.session = NULL; 171 test_addr.session = NULL;
172 addr.addr = GNUNET_strdup ("test"); 172 test_addr.addr = GNUNET_strdup ("test");
173 addr.addr_len = 4; 173 test_addr.addr_len = 4;
174 174
175 /* Adding address without session */ 175 /* Adding address without session */
176 address0.peer = p.id; 176 address0.peer = p.id;
177 address0.transport_name = addr.plugin; 177 address0.transport_name = test_addr.plugin;
178 address0.address = addr.addr; 178 address0.address = test_addr.addr;
179 address0.address_length = addr.addr_len; 179 address0.address_length = test_addr.addr_len;
180 GNUNET_ATS_address_add (ats, &address0, addr.session, NULL, 0); 180 GNUNET_ATS_address_add (ats, &address0, test_addr.session, NULL, 0);
181 181
182 addr.session = &addr; 182 test_addr.session = &test_addr;
183 /* Update address with session */ 183 /* Update address with session */
184 GNUNET_ATS_address_add (ats, &address0, addr.session, NULL, 0); 184 GNUNET_ATS_address_add (ats, &address0, test_addr.session, NULL, 0);
185 185
186 /* Update address with session */ 186 /* Update address with session */
187 addr.session = &address0; 187 test_addr.session = &address0;
188 GNUNET_assert (GNUNET_OK == GNUNET_ATS_address_add (ats, &address0, addr.session, NULL, 0)); 188 GNUNET_assert (GNUNET_OK == GNUNET_ATS_address_add (ats, &address0, test_addr.session, NULL, 0));
189 GNUNET_log_skip (2, GNUNET_NO); 189 GNUNET_log_skip (2, GNUNET_NO);
190 GNUNET_assert (GNUNET_SYSERR == GNUNET_ATS_address_add (ats, &address0, addr.session, NULL, 0)); 190 GNUNET_assert (GNUNET_SYSERR == GNUNET_ATS_address_add (ats, &address0, test_addr.session, NULL, 0));
191 191
192 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Requesting peer `%s'\n", 192 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Requesting peer `%s'\n",
193 GNUNET_i2s (&p.id)); 193 GNUNET_i2s (&p.id));