mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Another log testing helper helper, for matching partial strings.
This commit is contained in:
parent
debe846cb8
commit
14c07f3f21
@ -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)
|
||||
|
@ -25,6 +25,7 @@ int setup_capture_of_logs(int new_level);
|
||||
void teardown_capture_of_logs(int prev);
|
||||
|
||||
int mock_saved_log_has_message(const char *msg);
|
||||
int mock_saved_log_has_message_containing(const char *msg);
|
||||
int mock_saved_log_has_severity(int severity);
|
||||
int mock_saved_log_has_entry(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user