diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-14 12:17:47 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-14 12:17:47 +0000 |
commit | f108c06868a1a9062e0098b6bc7dfeb9dcfddfe1 (patch) | |
tree | d1e72b0c949fac18f67d7057689a7dfb65e088e4 /src/testing/test_testing_topology.c | |
parent | cc3a0bc78da6f3d29003e1f84c57742e9cf3da3c (diff) | |
download | gnunet-f108c06868a1a9062e0098b6bc7dfeb9dcfddfe1.tar.gz gnunet-f108c06868a1a9062e0098b6bc7dfeb9dcfddfe1.zip |
changes to use names instead of numbers for topologies and topology options
Diffstat (limited to 'src/testing/test_testing_topology.c')
-rw-r--r-- | src/testing/test_testing_topology.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index 5d71d2016..dfc59ab74 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c | |||
@@ -658,11 +658,11 @@ run (void *cls, | |||
658 | char *const *args, | 658 | char *const *args, |
659 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | 659 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
660 | { | 660 | { |
661 | unsigned long long topology_num; | 661 | char * topology_str; |
662 | unsigned long long connect_topology_num; | 662 | char * connect_topology_str; |
663 | unsigned long long blacklist_topology_num; | 663 | char * blacklist_topology_str; |
664 | unsigned long long connect_topology_option_num; | 664 | char * connect_topology_option_str; |
665 | char *connect_topology_option_modifier_string; | 665 | char * connect_topology_option_modifier_string; |
666 | sched = s; | 666 | sched = s; |
667 | ok = 1; | 667 | ok = 1; |
668 | 668 | ||
@@ -683,20 +683,31 @@ run (void *cls, | |||
683 | return; | 683 | return; |
684 | } | 684 | } |
685 | 685 | ||
686 | if (GNUNET_YES == | 686 | if ((GNUNET_YES == |
687 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "topology", | 687 | GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "topology", |
688 | &topology_num)) | 688 | &topology_str)) && (GNUNET_NO == GNUNET_TESTING_topology_get(&topology, topology_str))) |
689 | topology = topology_num; | 689 | { |
690 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
691 | "Invalid topology `%s' given for section %s option %s\n", topology_str, "TESTING", "TOPOLOGY"); | ||
692 | topology = GNUNET_TESTING_TOPOLOGY_CLIQUE; /* Defaults to NONE, so set better default here */ | ||
693 | } | ||
690 | 694 | ||
691 | if (GNUNET_YES == | 695 | if ((GNUNET_YES == |
692 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_topology", | 696 | GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "connect_topology", |
693 | &connect_topology_num)) | 697 | &connect_topology_str)) && (GNUNET_NO == GNUNET_TESTING_topology_get(&connection_topology, connect_topology_str))) |
694 | connection_topology = connect_topology_num; | 698 | { |
699 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
700 | "Invalid connect topology `%s' given for section %s option %s\n", connect_topology_str, "TESTING", "CONNECT_TOPOLOGY"); | ||
701 | } | ||
695 | 702 | ||
696 | if (GNUNET_YES == | 703 | if ((GNUNET_YES == |
697 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_topology_option", | 704 | GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "connect_topology_option", |
698 | &connect_topology_option_num)) | 705 | &connect_topology_option_str)) && (GNUNET_NO == GNUNET_TESTING_topology_option_get(&connect_topology_option, connect_topology_option_str))) |
699 | connect_topology_option = connect_topology_option_num; | 706 | { |
707 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
708 | "Invalid connect topology option `%s' given for section %s option %s\n", connect_topology_option_str, "TESTING", "CONNECT_TOPOLOGY_OPTION"); | ||
709 | connect_topology_option = GNUNET_TESTING_TOPOLOGY_OPTION_ALL; /* Defaults to NONE, set to ALL */ | ||
710 | } | ||
700 | 711 | ||
701 | if (GNUNET_YES == | 712 | if (GNUNET_YES == |
702 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "connect_topology_option_modifier", | 713 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "connect_topology_option_modifier", |
@@ -717,10 +728,13 @@ run (void *cls, | |||
717 | &blacklist_transports)) | 728 | &blacklist_transports)) |
718 | blacklist_transports = NULL; | 729 | blacklist_transports = NULL; |
719 | 730 | ||
720 | if (GNUNET_YES == | 731 | if ((GNUNET_YES == |
721 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "blacklist_topology", | 732 | GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "blacklist_topology", |
722 | &blacklist_topology_num)) | 733 | & blacklist_topology_str)) && (GNUNET_NO == GNUNET_TESTING_topology_get(&blacklist_topology, blacklist_topology_str))) |
723 | blacklist_topology = blacklist_topology_num; | 734 | { |
735 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
736 | "Invalid topology `%s' given for section %s option %s\n", topology_str, "TESTING", "BLACKLIST_TOPOLOGY"); | ||
737 | } | ||
724 | 738 | ||
725 | if (GNUNET_SYSERR == | 739 | if (GNUNET_SYSERR == |
726 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers", | 740 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers", |