diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-04 10:44:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-04 10:44:36 -0400 |
commit | 94b04d6c64ec998a9117d65a156888fa3af188e5 (patch) | |
tree | 08ed94f695e8c1b9abef413a8bfee98c8be07be8 /src/test/log_test_helpers.c | |
parent | 1c62adb65baa99c92f937318c452955306301643 (diff) | |
parent | 81f4223329a709e5138532b037a58c118b30dd7f (diff) | |
download | tor-94b04d6c64ec998a9117d65a156888fa3af188e5.tar.gz tor-94b04d6c64ec998a9117d65a156888fa3af188e5.zip |
Merge branch 'bug24104_029_squashed'
Diffstat (limited to 'src/test/log_test_helpers.c')
-rw-r--r-- | src/test/log_test_helpers.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c index 0d0f7574c3..2e91b1ecdc 100644 --- a/src/test/log_test_helpers.c +++ b/src/test/log_test_helpers.c @@ -158,6 +158,26 @@ mock_saved_log_has_message_containing(const char *msg) return 0; } +/** + * Return true iff there is not a message recorded by log capture + * that contains <b>msg</b> as a substring. + */ +int +mock_saved_log_has_message_not_containing(const char *msg) +{ + if (saved_logs) { + SMARTLIST_FOREACH( + saved_logs, mock_saved_log_entry_t *, m, + { + if (msg && m->generated_msg && strstr(m->generated_msg, msg)) + return 0; + } + ); + } + + return 1; +} + /** Return true iff the saved logs have any messages with <b>severity</b> */ int mock_saved_log_has_severity(int severity) |