[tor-commits] [tor/master] Merge branch 'feature17840-v11-tests_truncated'
nickm at torproject.org
nickm at torproject.org
Thu Feb 11 17:46:33 UTC 2016
commit 2b5ff5259408bf7dc17939c6f15eb9e1e68215fa
Merge: ba2be81 b316c87
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Feb 11 12:45:51 2016 -0500
Merge branch 'feature17840-v11-tests_truncated'
src/test/log_test_helpers.h | 1 +
src/test/test_options.c | 124 ++++++++++++++++++++++++++++++++++++++++----
2 files changed, 116 insertions(+), 9 deletions(-)
diff --cc src/test/log_test_helpers.h
index 298237d,3a565c6..02f31a5
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@@ -23,33 -23,10 +23,34 @@@ void mock_clean_saved_logs(void)
const smartlist_t *mock_saved_logs(void);
int setup_capture_of_logs(int new_level);
void teardown_capture_of_logs(int prev);
-const char *mock_saved_log_at(int ix);
-int mock_saved_severity_at(int ix);
-int mock_saved_log_number(void);
++
int mock_saved_log_has_message(const char *msg);
+int mock_saved_log_has_severity(int severity);
+int mock_saved_log_has_entry(void);
+
+#define expect_log_msg(str) \
+ tt_assert_msg(mock_saved_log_has_message(str), \
+ "expected log to contain " # str);
+
+#define expect_no_log_msg(str) \
+ tt_assert_msg(!mock_saved_log_has_message(str), \
+ "expected log to not contain " # str);
+
+#define expect_log_severity(severity) \
+ tt_assert_msg(mock_saved_log_has_severity(severity), \
+ "expected log to contain severity " # severity);
+
+#define expect_no_log_severity(severity) \
+ tt_assert_msg(!mock_saved_log_has_severity(severity), \
+ "expected log to not contain severity " # severity);
+
+#define expect_log_entry() \
+ tt_assert_msg(mock_saved_log_has_entry(), \
+ "expected log to contain entries");
+
+#define expect_no_log_entry() \
+ tt_assert_msg(!mock_saved_log_has_entry(), \
+ "expected log to not contain entries");
#endif
More information about the tor-commits
mailing list