summaryrefslogtreecommitdiff
path: root/src/test/log_test_helpers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-04 10:44:36 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 10:44:36 -0400
commit94b04d6c64ec998a9117d65a156888fa3af188e5 (patch)
tree08ed94f695e8c1b9abef413a8bfee98c8be07be8 /src/test/log_test_helpers.c
parent1c62adb65baa99c92f937318c452955306301643 (diff)
parent81f4223329a709e5138532b037a58c118b30dd7f (diff)
downloadtor-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.c20
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)