diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-12 13:28:07 -0500 |
commit | a3dafd3f58bb3122b9de919e931c02b5e12373b2 (patch) | |
tree | 3df98129cf51f089d4edb734f55ea86f5b8e8e74 /src/test/test_logging.c | |
parent | 2170171d84e30bc4b1b2565255bd978668c50e97 (diff) | |
download | tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.tar.gz tor-a3dafd3f58bb3122b9de919e931c02b5e12373b2.zip |
Replace operators used as macro arguments with OP_XX macros
Part of fix for 13172
Diffstat (limited to 'src/test/test_logging.c')
-rw-r--r-- | src/test/test_logging.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/test/test_logging.c b/src/test/test_logging.c index 9d9cbae6a8..17f1ed566c 100644 --- a/src/test/test_logging.c +++ b/src/test/test_logging.c @@ -22,8 +22,8 @@ test_get_sigsafe_err_fds(void *arg) init_logging(1); n = tor_log_get_sigsafe_err_fds(&fds); - tt_int_op(n, ==, 1); - tt_int_op(fds[0], ==, STDERR_FILENO); + tt_int_op(n, OP_EQ, 1); + tt_int_op(fds[0], OP_EQ, STDERR_FILENO); set_log_severity_config(LOG_WARN, LOG_ERR, &include_bug); set_log_severity_config(LOG_WARN, LOG_ERR, &no_bug); @@ -40,26 +40,26 @@ test_get_sigsafe_err_fds(void *arg) tor_log_update_sigsafe_err_fds(); n = tor_log_get_sigsafe_err_fds(&fds); - tt_int_op(n, ==, 2); - tt_int_op(fds[0], ==, STDERR_FILENO); - tt_int_op(fds[1], ==, 3); + tt_int_op(n, OP_EQ, 2); + tt_int_op(fds[0], OP_EQ, STDERR_FILENO); + tt_int_op(fds[1], OP_EQ, 3); /* Allow STDOUT to replace STDERR. */ add_stream_log(&include_bug, "dummy-4", STDOUT_FILENO); tor_log_update_sigsafe_err_fds(); n = tor_log_get_sigsafe_err_fds(&fds); - tt_int_op(n, ==, 2); - tt_int_op(fds[0], ==, 3); - tt_int_op(fds[1], ==, STDOUT_FILENO); + tt_int_op(n, OP_EQ, 2); + tt_int_op(fds[0], OP_EQ, 3); + tt_int_op(fds[1], OP_EQ, STDOUT_FILENO); /* But don't allow it to replace explicit STDERR. */ add_stream_log(&include_bug, "dummy-5", STDERR_FILENO); tor_log_update_sigsafe_err_fds(); n = tor_log_get_sigsafe_err_fds(&fds); - tt_int_op(n, ==, 3); - tt_int_op(fds[0], ==, STDERR_FILENO); - tt_int_op(fds[1], ==, STDOUT_FILENO); - tt_int_op(fds[2], ==, 3); + tt_int_op(n, OP_EQ, 3); + tt_int_op(fds[0], OP_EQ, STDERR_FILENO); + tt_int_op(fds[1], OP_EQ, STDOUT_FILENO); + tt_int_op(fds[2], OP_EQ, 3); /* Don't overflow the array. */ { @@ -70,7 +70,7 @@ test_get_sigsafe_err_fds(void *arg) } tor_log_update_sigsafe_err_fds(); n = tor_log_get_sigsafe_err_fds(&fds); - tt_int_op(n, ==, 8); + tt_int_op(n, OP_EQ, 8); done: ; @@ -109,7 +109,7 @@ test_sigsafe_err(void *arg) tt_assert(content != NULL); tor_split_lines(lines, content, (int)strlen(content)); - tt_int_op(smartlist_len(lines), >=, 5); + tt_int_op(smartlist_len(lines), OP_GE, 5); if (strstr(smartlist_get(lines, 0), "opening new log file")) smartlist_del_keeporder(lines, 0); @@ -119,7 +119,7 @@ test_sigsafe_err(void *arg) 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), ==, + tt_str_op(smartlist_get(lines, 4), OP_EQ, "Testing any attempt to manually log from a signal."); done: |