diff options
author | teor <teor@torproject.org> | 2019-10-25 17:23:46 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-25 17:23:46 +1000 |
commit | 0ae530c8f617fbc512bdf112530d5ec85281e0a8 (patch) | |
tree | f7cf378124969075a69fcf679c166c3c81bf156e /src/test/test_options.c | |
parent | 60aa6dac342c732269cbeb23c9652e816605387e (diff) | |
download | tor-0ae530c8f617fbc512bdf112530d5ec85281e0a8.tar.gz tor-0ae530c8f617fbc512bdf112530d5ec85281e0a8.zip |
test: Use SEVERITY_MASK_IDX() to find the LOG_* mask indexes
In the unit tests.
Fixes a regression to bug 31334; bug not in any released version of tor.
Diffstat (limited to 'src/test/test_options.c')
-rw-r--r-- | src/test/test_options.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/test/test_options.c b/src/test/test_options.c index 9b60bedff6..8a64ce6732 100644 --- a/src/test/test_options.c +++ b/src/test/test_options.c @@ -4006,9 +4006,9 @@ test_options_init_logs_quiet(void *arg) tt_assert(a); tt_assert(a->stream); tt_int_op(a->fd, OP_EQ, fileno(stdout)); - tt_u64_op(a->sev.masks[LOG_INFO-LOG_ERR], OP_EQ, 0); - tt_u64_op(a->sev.masks[LOG_NOTICE-LOG_ERR], OP_EQ, 0); - tt_u64_op(a->sev.masks[LOG_WARN-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_INFO)], OP_EQ, 0); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_NOTICE)], OP_EQ, 0); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_WARN)], OP_EQ, LD_ALL_DOMAINS); clear_added_logs(); quiet_level = QUIET_NONE; @@ -4019,9 +4019,10 @@ test_options_init_logs_quiet(void *arg) tt_assert(a); tt_assert(a->stream); tt_int_op(a->fd, OP_EQ, fileno(stdout)); - tt_u64_op(a->sev.masks[LOG_INFO-LOG_ERR], OP_EQ, 0); - tt_u64_op(a->sev.masks[LOG_NOTICE-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); - tt_u64_op(a->sev.masks[LOG_WARN-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_INFO)], OP_EQ, 0); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_NOTICE)], OP_EQ, + LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_WARN)], OP_EQ, LD_ALL_DOMAINS); clear_added_logs(); /* Make sure that adding a configured log makes the default logs go away. */ @@ -4035,9 +4036,10 @@ test_options_init_logs_quiet(void *arg) tt_assert(a); tt_assert(! a->stream); tt_int_op(a->fd, OP_NE, fileno(stdout)); - tt_u64_op(a->sev.masks[LOG_INFO-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); - tt_u64_op(a->sev.masks[LOG_NOTICE-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); - tt_u64_op(a->sev.masks[LOG_WARN-LOG_ERR], OP_EQ, LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_INFO)], OP_EQ, LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_NOTICE)], OP_EQ, + LD_ALL_DOMAINS); + tt_u64_op(a->sev.masks[SEVERITY_MASK_IDX(LOG_WARN)], OP_EQ, LD_ALL_DOMAINS); done: free_options_test_data(tdata); |