tor_procmon_callback_t cb, void *cb_arg,
const char **msg)
{
- tor_process_monitor_t *procmon = tor_malloc_zero(sizeof(tor_process_monitor_t));
+ tor_process_monitor_t *procmon = tor_malloc_zero(
+ sizeof(tor_process_monitor_t));
struct parsed_process_specifier_t ppspec;
tor_assert(msg != NULL);
mock_saved_log_at(int ix)
{
int saved_log_count = mock_saved_log_number();
- if(ix < 0) {
+ if (ix < 0) {
ix = saved_log_count + ix;
}
if (saved_log_count <= ix)
return "";
- return ((mock_saved_log_entry_t *)smartlist_get(saved_logs, ix))->generated_msg;
+ return ((mock_saved_log_entry_t *)
+ smartlist_get(saved_logs, ix))->generated_msg;
}
int
mock_saved_severity_at(int ix)
{
int saved_log_count = mock_saved_log_number();
- if(ix < 0) {
+ if (ix < 0) {
ix = saved_log_count + ix;
}
}
void
-mock_saving_logv(int severity, log_domain_mask_t domain, const char *funcname, const char *suffix, const char *format, va_list ap)
+mock_saving_logv(int severity, log_domain_mask_t domain, const char *funcname,
+ const char *suffix, const char *format, va_list ap)
{
(void)domain;
char *buf = tor_malloc_zero(10240);
struct mock_saved_log_entry_t *next;
} mock_saved_log_entry_t;
-void mock_saving_logv(int severity, log_domain_mask_t domain, const char *funcname, const char *suffix, const char *format, va_list ap);
+void mock_saving_logv(int severity, log_domain_mask_t domain,
+ const char *funcname, const char *suffix,
+ const char *format, va_list ap);
void mock_clean_saved_logs(void);
const smartlist_t *mock_saved_logs(void);
int setup_capture_of_logs(int new_level);
tt_assert(!res);
tt_str_op(msg, OP_EQ, "invalid PID");
- res = tor_process_monitor_new(tor_libevent_get_base(), "43", 0, NULL, NULL, &msg);
+ res = tor_process_monitor_new(tor_libevent_get_base(), "43", 0,
+ NULL, NULL, &msg);
tt_assert(res);
tt_assert(!msg);
- res = tor_process_monitor_new(tor_libevent_get_base(), "44 hello", 0, NULL, NULL, &msg);
+ res = tor_process_monitor_new(tor_libevent_get_base(), "44 hello", 0,
+ NULL, NULL, &msg);
tt_assert(res);
tt_assert(!msg);
- res = tor_process_monitor_new(tor_libevent_get_base(), "45:hello", 0, NULL, NULL, &msg);
+ res = tor_process_monitor_new(tor_libevent_get_base(), "45:hello", 0,
+ NULL, NULL, &msg);
tt_assert(res);
tt_assert(!msg);
}
struct testcase_t procmon_tests[] = {
- { "tor_process_monitor_new", test_procmon_tor_process_monitor_new, TT_FORK, NULL, NULL },
+ { "tor_process_monitor_new", test_procmon_tor_process_monitor_new,
+ TT_FORK, NULL, NULL },
END_OF_TESTCASES
};