1 /* Copyright (c) 2010-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
5 #include "core/or/or.h"
8 #include "lib/evloop/procmon.h"
10 #include "test/log_test_helpers.h"
15 test_procmon_tor_process_monitor_new(void *ignored
)
18 tor_process_monitor_t
*res
;
21 res
= tor_process_monitor_new(NULL
, "probably invalid", 0, NULL
, NULL
, &msg
);
23 tt_str_op(msg
, OP_EQ
, "invalid PID");
25 res
= tor_process_monitor_new(NULL
, "243443535345454", 0, NULL
, NULL
, &msg
);
27 tt_str_op(msg
, OP_EQ
, "invalid PID");
29 res
= tor_process_monitor_new(tor_libevent_get_base(), "43", 0,
33 tor_process_monitor_free(res
);
35 res
= tor_process_monitor_new(tor_libevent_get_base(), "44 hello", 0,
39 tor_process_monitor_free(res
);
41 res
= tor_process_monitor_new(tor_libevent_get_base(), "45:hello", 0,
47 tor_process_monitor_free(res
);
50 struct testcase_t procmon_tests
[] = {
51 { "tor_process_monitor_new", test_procmon_tor_process_monitor_new
,
52 TT_FORK
, NULL
, NULL
},