commit dcfed8c1c8e8b3a63284249cf318dd353ea44d7d Author: Nick Mathewson nickm@torproject.org Date: Fri May 19 08:55:14 2017 -0400
tt_* macros can "goto done;" so define any freeable things before them. --- src/test/test_config.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/test/test_config.c b/src/test/test_config.c index 983fe88..8419acb 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -4815,6 +4815,7 @@ test_config_include_limit(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_limit")); tt_ptr_op(dir, OP_NE, NULL);
@@ -4831,7 +4832,6 @@ test_config_include_limit(void *data) torrc_path); tt_int_op(write_str_to_file(torrc_path, torrc_contents, 0), OP_EQ, 0);
- config_line_t *result = NULL; tt_int_op(config_get_lines_include(torrc_contents, &result, 0, NULL), OP_EQ, -1);
@@ -4845,6 +4845,7 @@ test_config_include_does_not_exist(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_does_not_exist")); tt_ptr_op(dir, OP_NE, NULL);
@@ -4861,7 +4862,6 @@ test_config_include_does_not_exist(void *data) tor_snprintf(torrc_contents, sizeof(torrc_contents), "%%include %s", missing_path);
- config_line_t *result = NULL; tt_int_op(config_get_lines_include(torrc_contents, &result, 0, NULL), OP_EQ, -1);
@@ -4874,6 +4874,7 @@ static void test_config_include_error_in_included_file(void *data) { (void)data; + config_line_t *result = NULL;
char *dir = tor_strdup(get_fname("test_error_in_included_file")); tt_ptr_op(dir, OP_NE, NULL); @@ -4893,7 +4894,6 @@ test_config_include_error_in_included_file(void *data) tor_snprintf(torrc_contents, sizeof(torrc_contents), "%%include %s", invalid_path);
- config_line_t *result = NULL; tt_int_op(config_get_lines_include(torrc_contents, &result, 0, NULL), OP_EQ, -1);
@@ -4906,6 +4906,7 @@ static void test_config_include_empty_file_folder(void *data) { (void)data; + config_line_t *result = NULL;
char *dir = tor_strdup(get_fname("test_include_empty_file_folder")); tt_ptr_op(dir, OP_NE, NULL); @@ -4935,7 +4936,6 @@ test_config_include_empty_file_folder(void *data) "%%include %s\n", folder_path, file_path);
- config_line_t *result = NULL; int include_used; tt_int_op(config_get_lines_include(torrc_contents, &result, 0,&include_used), OP_EQ, 0); @@ -4952,6 +4952,7 @@ test_config_include_recursion_before_after(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_recursion_before_after")); tt_ptr_op(dir, OP_NE, NULL);
@@ -4987,7 +4988,6 @@ test_config_include_recursion_before_after(void *data) } }
- config_line_t *result = NULL; int include_used; tt_int_op(config_get_lines_include(file_contents, &result, 0, &include_used), OP_EQ, 0); @@ -5015,6 +5015,7 @@ test_config_include_recursion_after_only(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_recursion_after_only")); tt_ptr_op(dir, OP_NE, NULL);
@@ -5050,7 +5051,6 @@ test_config_include_recursion_after_only(void *data) } }
- config_line_t *result = NULL; int include_used; tt_int_op(config_get_lines_include(file_contents, &result, 0, &include_used), OP_EQ, 0); @@ -5078,6 +5078,7 @@ test_config_include_folder_order(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_folder_order")); tt_ptr_op(dir, OP_NE, NULL);
@@ -5134,7 +5135,6 @@ test_config_include_folder_order(void *data) "%%include %s\n", torrcd);
- config_line_t *result = NULL; int include_used; tt_int_op(config_get_lines_include(torrc_contents, &result, 0,&include_used), OP_EQ, 0); @@ -5162,6 +5162,7 @@ test_config_include_path_syntax(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_path_syntax")); tt_ptr_op(dir, OP_NE, NULL);
@@ -5178,7 +5179,6 @@ test_config_include_path_syntax(void *data) "%%include "%s"PATH_SEPARATOR""\n", dir, dir, dir);
- config_line_t *result = NULL; int include_used; tt_int_op(config_get_lines_include(torrc_contents, &result, 0,&include_used), OP_EQ, 0); @@ -5218,6 +5218,7 @@ test_config_include_has_include(void *data) { (void)data;
+ config_line_t *result = NULL; char *dir = tor_strdup(get_fname("test_include_has_include")); tt_ptr_op(dir, OP_NE, NULL);
@@ -5228,7 +5229,6 @@ test_config_include_has_include(void *data) #endif
char torrc_contents[1000] = "Test 1\n"; - config_line_t *result = NULL; int include_used;
tt_int_op(config_get_lines_include(torrc_contents, &result, 0,&include_used),