aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_logging.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-11-26 05:34:30 +0100
committerNick Mathewson <nickm@torproject.org>2018-12-17 16:39:28 -0500
commitf7d13425fc738d7d56d5582b9be8510ac236c076 (patch)
tree55852691651993b2c1d12234e290dd0f2bbed516 /src/test/test_logging.c
parent289ed0849d9b473cd0fbafada30c03638d73e541 (diff)
downloadtor-f7d13425fc738d7d56d5582b9be8510ac236c076.tar.gz
tor-f7d13425fc738d7d56d5582b9be8510ac236c076.zip
Delete old process_handle_t code.
This patch removes the old process_handle_t code. Everything should by now be using the process_t interface. See: https://bugs.torproject.org/28179
Diffstat (limited to 'src/test/test_logging.c')
-rw-r--r--src/test/test_logging.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/test/test_logging.c b/src/test/test_logging.c
index cd685a4af7..9d3ee5d55f 100644
--- a/src/test/test_logging.c
+++ b/src/test/test_logging.c
@@ -117,22 +117,27 @@ test_sigsafe_err(void *arg)
content = read_file_to_str(fn, 0, NULL);
tt_ptr_op(content, OP_NE, NULL);
- tor_split_lines(lines, content, (int)strlen(content));
+ smartlist_split_string(lines, content, "\n", 0, 0);
tt_int_op(smartlist_len(lines), OP_GE, 5);
- if (strstr(smartlist_get(lines, 0), "opening new log file"))
+ if (strstr(smartlist_get(lines, 0), "opening new log file")) {
+ void *item = smartlist_get(lines, 0);
smartlist_del_keeporder(lines, 0);
+ tor_free(item);
+ }
+
tt_assert(strstr(smartlist_get(lines, 0), "Say, this isn't too cool"));
- /* Next line is blank. */
- tt_assert(!strcmpstart(smartlist_get(lines, 1), "=============="));
- tt_assert(!strcmpstart(smartlist_get(lines, 2), "Minimal."));
- /* Next line is blank. */
- tt_assert(!strcmpstart(smartlist_get(lines, 3), "=============="));
- tt_str_op(smartlist_get(lines, 4), OP_EQ,
+ tt_str_op(smartlist_get(lines, 1), OP_EQ, "");
+ tt_assert(!strcmpstart(smartlist_get(lines, 2), "=============="));
+ tt_assert(!strcmpstart(smartlist_get(lines, 3), "Minimal."));
+ tt_str_op(smartlist_get(lines, 4), OP_EQ, "");
+ tt_assert(!strcmpstart(smartlist_get(lines, 5), "=============="));
+ tt_str_op(smartlist_get(lines, 6), OP_EQ,
"Testing any attempt to manually log from a signal.");
done:
tor_free(content);
+ SMARTLIST_FOREACH(lines, char *, x, tor_free(x));
smartlist_free(lines);
}