From c76f29f898f6b1a73f33ce6d2578e06ce8e0a24e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 17 Jan 2015 21:31:48 +0000 Subject: use ATS functions to convert quality network type to string, instead of using string API --- src/transport/test_quota_compliance.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/transport/test_quota_compliance.c') diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index 250d3279f..d1e388506 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c @@ -415,7 +415,6 @@ static char * generate_config (char *cfg_file, unsigned long long quota_in, unsigned long long quota_out) { - char *networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkTypeString; char *in_name; char *out_name; char *fname = NULL; @@ -430,12 +429,16 @@ generate_config (char *cfg_file, unsigned long long quota_in, for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++) { - GNUNET_asprintf (&in_name, "%s_QUOTA_IN", networks[c]); - GNUNET_asprintf (&out_name, "%s_QUOTA_OUT", networks[c]); - GNUNET_CONFIGURATION_set_value_number (cfg, "ats", in_name, quota_in); - GNUNET_CONFIGURATION_set_value_number (cfg, "ats", out_name, quota_out); - GNUNET_free (in_name); - GNUNET_free (out_name); + GNUNET_asprintf (&in_name, + "%s_QUOTA_IN", + GNUNET_ATS_print_network_type (c)); + GNUNET_asprintf (&out_name, + "%s_QUOTA_OUT", + GNUNET_ATS_print_network_type (c)); + GNUNET_CONFIGURATION_set_value_number (cfg, "ats", in_name, quota_in); + GNUNET_CONFIGURATION_set_value_number (cfg, "ats", out_name, quota_out); + GNUNET_free (in_name); + GNUNET_free (out_name); } GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write (cfg, fname)); GNUNET_CONFIGURATION_destroy (cfg); -- cgit v1.2.3