summaryrefslogtreecommitdiff
path: root/src/test/log_test_helpers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-31 11:35:12 -0400
committerNick Mathewson <nickm@torproject.org>2016-08-31 11:35:12 -0400
commit14c07f3f2199053e92c6bea90da332efbb3811e4 (patch)
tree5af209dc5eadb83335afad36e3a5f24c7b792cb9 /src/test/log_test_helpers.c
parentdebe846cb88c1157c1820c88a7128dd2362335d3 (diff)
downloadtor-14c07f3f2199053e92c6bea90da332efbb3811e4.tar.gz
tor-14c07f3f2199053e92c6bea90da332efbb3811e4.zip
Another log testing helper helper, for matching partial strings.
Diffstat (limited to 'src/test/log_test_helpers.c')
-rw-r--r--src/test/log_test_helpers.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 166a777747..1828689d1d 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -59,6 +59,23 @@ mock_saved_log_has_message(const char *msg)
return has_msg;
}
+int
+mock_saved_log_has_message_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 1;
+ }
+ });
+ }
+
+ return 0;
+}
+
+
/* Do the saved logs have any messages with severity? */
int
mock_saved_log_has_severity(int severity)