diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-29 16:12:25 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-29 16:12:25 +0000 |
commit | e427e88c6ae96e9b7eb30ebdf4c6b238226ad3e7 (patch) | |
tree | cf9d51ab95d53da443c8d32519e2f9664d71cacd /src/transport/test_quota_compliance.c | |
parent | c9120ae89d8ff588162c49ffa4553567d59f0351 (diff) | |
download | gnunet-e427e88c6ae96e9b7eb30ebdf4c6b238226ad3e7.tar.gz gnunet-e427e88c6ae96e9b7eb30ebdf4c6b238226ad3e7.zip |
a lot of new testcases
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r-- | src/transport/test_quota_compliance.c | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index 895b5c36a..d7f549b2d 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -680,6 +680,57 @@ main (int argc, char *argv[]) | |||
680 | is_udp = GNUNET_YES; | 680 | is_udp = GNUNET_YES; |
681 | } | 681 | } |
682 | 682 | ||
683 | if (strstr(argv[0], "asymmetric_recv") != NULL) | ||
684 | { | ||
685 | is_asymmetric_recv_constant = GNUNET_YES; | ||
686 | } | ||
687 | else | ||
688 | is_asymmetric_recv_constant = GNUNET_NO; | ||
689 | if (strstr(argv[0], "asymmetric_send") != NULL) | ||
690 | { | ||
691 | is_asymmetric_send_constant = GNUNET_YES; | ||
692 | } | ||
693 | else | ||
694 | is_asymmetric_send_constant = GNUNET_NO; | ||
695 | |||
696 | char * logger; | ||
697 | if (is_tcp == GNUNET_YES) | ||
698 | { | ||
699 | if (is_asymmetric_recv_constant == GNUNET_YES) | ||
700 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","asymmetric_recv_constant"); | ||
701 | else if (is_asymmetric_send_constant == GNUNET_YES) | ||
702 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","asymmetric_send_constant"); | ||
703 | else | ||
704 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","symmetric"); | ||
705 | } | ||
706 | if (is_udp == GNUNET_YES) | ||
707 | { | ||
708 | if (is_asymmetric_recv_constant == GNUNET_YES) | ||
709 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","asymmetric_recv_constant"); | ||
710 | else if (is_asymmetric_send_constant == GNUNET_YES) | ||
711 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","asymmetric_send_constant"); | ||
712 | else | ||
713 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","symmetric"); | ||
714 | } | ||
715 | if (is_http == GNUNET_YES) | ||
716 | { | ||
717 | if (is_asymmetric_recv_constant == GNUNET_YES) | ||
718 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","asymmetric_recv_constant"); | ||
719 | else if (is_asymmetric_send_constant == GNUNET_YES) | ||
720 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","asymmetric_send_constant"); | ||
721 | else | ||
722 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","symmetric"); | ||
723 | } | ||
724 | if (is_https == GNUNET_YES) | ||
725 | { | ||
726 | if (is_asymmetric_recv_constant == GNUNET_YES) | ||
727 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","asymmetric_recv_constant"); | ||
728 | else if (is_asymmetric_send_constant == GNUNET_YES) | ||
729 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","asymmetric_send_constant"); | ||
730 | else | ||
731 | GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","symmetric"); | ||
732 | } | ||
733 | |||
683 | GNUNET_log_setup ("test-quota-compliance", | 734 | GNUNET_log_setup ("test-quota-compliance", |
684 | #if VERBOSE | 735 | #if VERBOSE |
685 | "DEBUG", | 736 | "DEBUG", |
@@ -698,26 +749,14 @@ main (int argc, char *argv[]) | |||
698 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 749 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
699 | GNUNET_GETOPT_OPTION_END | 750 | GNUNET_GETOPT_OPTION_END |
700 | }; | 751 | }; |
701 | |||
702 | if (strstr(argv[0], "asymmetric_recv") != NULL) | ||
703 | { | ||
704 | is_asymmetric_recv_constant = GNUNET_YES; | ||
705 | } | ||
706 | else | ||
707 | is_asymmetric_recv_constant = GNUNET_NO; | ||
708 | if (strstr(argv[0], "asymmetric_send") != NULL) | ||
709 | { | ||
710 | is_asymmetric_send_constant = GNUNET_YES; | ||
711 | } | ||
712 | else | ||
713 | is_asymmetric_send_constant = GNUNET_NO; | ||
714 | ok = 1; | 752 | ok = 1; |
715 | GNUNET_PROGRAM_run ((sizeof (argv1) / sizeof (char *)) - 1, | 753 | GNUNET_PROGRAM_run ((sizeof (argv1) / sizeof (char *)) - 1, |
716 | argv1, "test-quota-compliance", "nohelp", | 754 | argv1, logger , "nohelp", |
717 | options, &run, &ok); | 755 | options, &run, &ok); |
718 | ret = ok; | 756 | ret = ok; |
719 | stop_arm (&p1); | 757 | stop_arm (&p1); |
720 | stop_arm (&p2); | 758 | stop_arm (&p2); |
759 | GNUNET_free(logger); | ||
721 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1"); | 760 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1"); |
722 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2"); | 761 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2"); |
723 | return ret; | 762 | return ret; |