diff options
author | juga0 <juga@riseup.net> | 2018-06-09 10:34:17 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-01 18:47:20 -0400 |
commit | 842b18ab26ac12da7e63c38413d193905b8fbed5 (patch) | |
tree | 456c33e458821be1682860c03355c98fbd0af7bf /src/test/log_test_helpers.h | |
parent | bbb82a52491de244fbdf5d7b6f22ae26f8b4ea19 (diff) | |
download | tor-842b18ab26ac12da7e63c38413d193905b8fbed5.tar.gz tor-842b18ab26ac12da7e63c38413d193905b8fbed5.zip |
Add test log helpers for msgs not containing str
Diffstat (limited to 'src/test/log_test_helpers.h')
-rw-r--r-- | src/test/log_test_helpers.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h index 922c68b42f..a087b913f4 100644 --- a/src/test/log_test_helpers.h +++ b/src/test/log_test_helpers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016, The Tor Project, Inc. */ +/* Copyright (c) 2014-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "or.h" @@ -24,6 +24,7 @@ void teardown_capture_of_logs(void); int mock_saved_log_has_message(const char *msg); int mock_saved_log_has_message_containing(const char *msg); +int mock_saved_log_has_message_not_containing(const char *msg); int mock_saved_log_has_severity(int severity); int mock_saved_log_has_entry(void); int mock_saved_log_n_entries(void); @@ -46,6 +47,10 @@ void mock_dump_saved_logs(void); assert_log_predicate(mock_saved_log_has_message_containing(str), \ "expected log to contain " # str); +#define expect_log_msg_not_containing(str) \ + assert_log_predicate(mock_saved_log_has_message_not_containing(str), \ + "expected log to not contain " # str); + #define expect_log_msg_containing_either(str1, str2) \ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \ mock_saved_log_has_message_containing(str2), \ |