aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-18 10:14:40 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-18 10:14:40 -0400
commitf8c9cc713d608fcd37d25730e91a88d4a1081f28 (patch)
tree66511f361dc9eb1915a7cc469f1001cf57337dbb /src/test
parentec8bdc5da81a27fd0d382db689addd8114347e1e (diff)
parentb355ddb20f534d772dcb42737ceb1d0264e2c3f1 (diff)
downloadtor-f8c9cc713d608fcd37d25730e91a88d4a1081f28.tar.gz
tor-f8c9cc713d608fcd37d25730e91a88d4a1081f28.zip
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c5
-rw-r--r--src/test/test_util.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 454fc54d52..6bf2d28d90 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -131,8 +131,7 @@ rm_rf(const char *dir)
elements = tor_listdir(dir);
if (elements) {
- SMARTLIST_FOREACH(elements, const char *, cp,
- {
+ SMARTLIST_FOREACH_BEGIN(elements, const char *, cp) {
char *tmp = NULL;
tor_asprintf(&tmp, "%s"PATH_SEPARATOR"%s", dir, cp);
if (0 == stat(tmp,&st) && (st.st_mode & S_IFDIR)) {
@@ -143,7 +142,7 @@ rm_rf(const char *dir)
}
}
tor_free(tmp);
- });
+ } SMARTLIST_FOREACH_END(cp);
SMARTLIST_FOREACH(elements, char *, cp, tor_free(cp));
smartlist_free(elements);
}
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 79573f5392..5c119d339b 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2679,8 +2679,7 @@ test_util_split_lines(void *ptr)
j = 0;
log_info(LD_GENERAL, "Splitting test %d of length %d",
i, tests[i].orig_length);
- SMARTLIST_FOREACH(sl, const char *, line,
- {
+ SMARTLIST_FOREACH_BEGIN(sl, const char *, line) {
/* Check we have not got too many lines */
test_assert(j < MAX_SPLIT_LINE_COUNT);
/* Check that there actually should be a line here */
@@ -2690,7 +2689,7 @@ test_util_split_lines(void *ptr)
/* Check that the line is as expected */
test_streq(line, tests[i].split_line[j]);
j++;
- });
+ } SMARTLIST_FOREACH_END(line);
/* Check that we didn't miss some lines */
test_eq_ptr(NULL, tests[i].split_line[j]);
tor_free(orig_line);