diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/test_plugin_transport_http.c | 23 | ||||
-rw-r--r-- | src/transport/test_plugin_transport_https.c | 18 | ||||
-rw-r--r-- | src/transport/test_quota_compliance.c | 4 |
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; | |||
392 | static void | 392 | static void |
393 | shutdown_clean () | 393 | shutdown_clean () |
394 | { | 394 | { |
395 | struct Plugin_Address * cur; | ||
396 | struct Plugin_Address * tmp; | 395 | struct Plugin_Address * tmp; |
397 | 396 | ||
398 | /* Evaluate results */ | 397 | /* Evaluate results */ |
@@ -432,7 +431,6 @@ shutdown_clean () | |||
432 | /* cleaning addresses */ | 431 | /* cleaning addresses */ |
433 | while (addr_head != NULL) | 432 | while (addr_head != NULL) |
434 | { | 433 | { |
435 | cur = addr_head; | ||
436 | tmp = addr_head->next; | 434 | tmp = addr_head->next; |
437 | GNUNET_free (addr_head->addr); | 435 | GNUNET_free (addr_head->addr); |
438 | GNUNET_free (addr_head); | 436 | GNUNET_free (addr_head); |
@@ -481,9 +479,6 @@ static void task_send_cont (void *cls, | |||
481 | const struct GNUNET_PeerIdentity * target, | 479 | const struct GNUNET_PeerIdentity * target, |
482 | int result) | 480 | int result) |
483 | { | 481 | { |
484 | struct Plugin_Address * tmp_addr; | ||
485 | tmp_addr = addr_head; | ||
486 | |||
487 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) | 482 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) |
488 | { | 483 | { |
489 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); | 484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); |
@@ -1195,13 +1190,13 @@ run (void *cls, | |||
1195 | 1190 | ||
1196 | /* assertions before start */ | 1191 | /* assertions before start */ |
1197 | GNUNET_assert ((port > 0) && (port <= 65535)); | 1192 | GNUNET_assert ((port > 0) && (port <= 65535)); |
1198 | GNUNET_assert(&my_public_key != NULL); | ||
1199 | GNUNET_assert(&my_identity.hashPubKey != NULL); | ||
1200 | 1193 | ||
1201 | /* load plugins... */ | 1194 | /* load plugins... */ |
1202 | setup_plugin_environment (); | 1195 | setup_plugin_environment (); |
1203 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http"); | 1196 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http"); |
1204 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading HTTP transport plugin `%s'\n"),libname); | 1197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1198 | _("Loading HTTP transport plugin `%s'\n"), | ||
1199 | libname); | ||
1205 | api = GNUNET_PLUGIN_load (libname, &env); | 1200 | api = GNUNET_PLUGIN_load (libname, &env); |
1206 | GNUNET_free (libname); | 1201 | GNUNET_free (libname); |
1207 | if (api == NULL) | 1202 | if (api == NULL) |
@@ -1217,14 +1212,17 @@ run (void *cls, | |||
1217 | 1212 | ||
1218 | /* testing plugin functionality */ | 1213 | /* testing plugin functionality */ |
1219 | GNUNET_assert (0!=fail_notify_address_count); | 1214 | GNUNET_assert (0!=fail_notify_address_count); |
1220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport plugin returned %u addresses to connect to\n", fail_notify_address_count); | 1215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1216 | "Transport plugin returned %u addresses to connect to\n", | ||
1217 | fail_notify_address_count); | ||
1221 | 1218 | ||
1222 | /* testing pretty printer with all addresses obtained from the plugin*/ | 1219 | /* testing pretty printer with all addresses obtained from the plugin*/ |
1223 | cur = addr_head; | 1220 | cur = addr_head; |
1224 | while (cur != NULL) | 1221 | while (cur != NULL) |
1225 | { | 1222 | { |
1226 | 1223 | api->address_pretty_printer (api->cls, "http", | |
1227 | api->address_pretty_printer (api->cls, "http",cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, &pretty_printer_cb,NULL); | 1224 | cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, |
1225 | &pretty_printer_cb, NULL); | ||
1228 | addr_str = api->address_to_string (api->cls, cur->addr, cur->addrlen); | 1226 | addr_str = api->address_to_string (api->cls, cur->addr, cur->addrlen); |
1229 | suggest_res = api->check_address (api->cls, cur->addr, cur->addrlen); | 1227 | suggest_res = api->check_address (api->cls, cur->addr, cur->addrlen); |
1230 | 1228 | ||
@@ -1337,7 +1335,8 @@ main (int argc, char *const *argv) | |||
1337 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; | 1335 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; |
1338 | 1336 | ||
1339 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin_http"); | 1337 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin_http"); |
1340 | 1338 | if (ret != GNUNET_OK) | |
1339 | return 1; | ||
1341 | return fail; | 1340 | return fail; |
1342 | } | 1341 | } |
1343 | 1342 | ||
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 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file transport/test_gnunet_transport_plugin.https.c | 21 | * @file transport/test_plugin_transport_https.c |
22 | * @brief testcase for gnunet_transport_plugin.https.c | 22 | * @brief testcase for plugin_transport_https.c |
23 | * @author Matthias Wachs | 23 | * @author Matthias Wachs |
24 | */ | 24 | */ |
25 | 25 | ||
@@ -395,7 +395,6 @@ static char * cert_file; | |||
395 | static void | 395 | static void |
396 | shutdown_clean () | 396 | shutdown_clean () |
397 | { | 397 | { |
398 | struct Plugin_Address * cur; | ||
399 | struct Plugin_Address * tmp; | 398 | struct Plugin_Address * tmp; |
400 | 399 | ||
401 | /* Evaluate results */ | 400 | /* Evaluate results */ |
@@ -435,7 +434,6 @@ shutdown_clean () | |||
435 | /* cleaning addresses */ | 434 | /* cleaning addresses */ |
436 | while (addr_head != NULL) | 435 | while (addr_head != NULL) |
437 | { | 436 | { |
438 | cur = addr_head; | ||
439 | tmp = addr_head->next; | 437 | tmp = addr_head->next; |
440 | GNUNET_free (addr_head->addr); | 438 | GNUNET_free (addr_head->addr); |
441 | GNUNET_free (addr_head); | 439 | GNUNET_free (addr_head); |
@@ -504,9 +502,6 @@ static void task_send_cont (void *cls, | |||
504 | const struct GNUNET_PeerIdentity * target, | 502 | const struct GNUNET_PeerIdentity * target, |
505 | int result) | 503 | int result) |
506 | { | 504 | { |
507 | struct Plugin_Address * tmp_addr; | ||
508 | tmp_addr = addr_head; | ||
509 | |||
510 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) | 505 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) |
511 | { | 506 | { |
512 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); | 507 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); |
@@ -1261,8 +1256,6 @@ run (void *cls, | |||
1261 | 1256 | ||
1262 | /* assertions before start */ | 1257 | /* assertions before start */ |
1263 | GNUNET_assert ((port > 0) && (port <= 65535)); | 1258 | GNUNET_assert ((port > 0) && (port <= 65535)); |
1264 | GNUNET_assert(&my_public_key != NULL); | ||
1265 | GNUNET_assert(&my_identity.hashPubKey != NULL); | ||
1266 | 1259 | ||
1267 | /* load plugins... */ | 1260 | /* load plugins... */ |
1268 | setup_plugin_environment (); | 1261 | setup_plugin_environment (); |
@@ -1401,9 +1394,10 @@ main (int argc, char *const *argv) | |||
1401 | "test_gnunet_transport_plugin.https", | 1394 | "test_gnunet_transport_plugin.https", |
1402 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; | 1395 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; |
1403 | 1396 | ||
1404 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https"); | 1397 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https"); |
1405 | 1398 | if (GNUNET_OK != ret) | |
1399 | return 1; | ||
1406 | return fail; | 1400 | return fail; |
1407 | } | 1401 | } |
1408 | 1402 | ||
1409 | /* end of test_gnunet_transport_plugin.http.c */ | 1403 | /* 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 | |||
236 | }; | 236 | }; |
237 | 237 | ||
238 | static unsigned int | 238 | static unsigned int |
239 | get_size (void) | 239 | get_size () |
240 | { | 240 | { |
241 | return MEASUREMENT_MSG_SIZE + sizeof (struct TestMessage); | 241 | return MEASUREMENT_MSG_SIZE + sizeof (struct TestMessage); |
242 | } | 242 | } |
@@ -247,11 +247,9 @@ notify_receive_new (void *cls, | |||
247 | const struct GNUNET_MessageHeader *message, | 247 | const struct GNUNET_MessageHeader *message, |
248 | const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count) | 248 | const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count) |
249 | { | 249 | { |
250 | unsigned int s; | ||
251 | const struct TestMessage *hdr; | 250 | const struct TestMessage *hdr; |
252 | 251 | ||
253 | hdr = (const struct TestMessage*) message; | 252 | hdr = (const struct TestMessage*) message; |
254 | s = get_size (); | ||
255 | if (measurement_running == GNUNET_NO) | 253 | if (measurement_running == GNUNET_NO) |
256 | return; | 254 | return; |
257 | if (MTYPE != ntohs (message->type)) | 255 | if (MTYPE != ntohs (message->type)) |