diff --git a/src/common/procmon.c b/src/common/procmon.c index 89c9d751e5..8c59cadebb 100644 --- a/src/common/procmon.c +++ b/src/common/procmon.c @@ -192,7 +192,8 @@ tor_process_monitor_new(struct event_base *base, 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); diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c index 0efa3ceac3..7dae488cb1 100644 --- a/src/test/log_test_helpers.c +++ b/src/test/log_test_helpers.c @@ -37,20 +37,21 @@ const char * 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; } @@ -74,7 +75,8 @@ mock_saved_logs(void) } 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); diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h index debc167d59..58d14d92aa 100644 --- a/src/test/log_test_helpers.h +++ b/src/test/log_test_helpers.h @@ -15,7 +15,9 @@ typedef struct mock_saved_log_entry_t { 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); diff --git a/src/test/test_procmon.c b/src/test/test_procmon.c index ac70a0f3db..6a9c209f7c 100644 --- a/src/test/test_procmon.c +++ b/src/test/test_procmon.c @@ -29,15 +29,18 @@ test_procmon_tor_process_monitor_new(void *ignored) 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); @@ -46,6 +49,7 @@ test_procmon_tor_process_monitor_new(void *ignored) } 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 };