1 /* Copyright (c) 2010-2018, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 #define PROCMON_PRIVATE
6 #include "core/or/or.h"
9 #include "lib/evloop/procmon.h"
11 #include "test/log_test_helpers.h"
13 #define NS_MODULE procmon
18 test_procmon_tor_process_monitor_new(void *ignored
)
21 tor_process_monitor_t
*res
;
24 res
= tor_process_monitor_new(NULL
, "probably invalid", 0, NULL
, NULL
, &msg
);
26 tt_str_op(msg
, OP_EQ
, "invalid PID");
28 res
= tor_process_monitor_new(NULL
, "243443535345454", 0, NULL
, NULL
, &msg
);
30 tt_str_op(msg
, OP_EQ
, "invalid PID");
32 res
= tor_process_monitor_new(tor_libevent_get_base(), "43", 0,
36 tor_process_monitor_free(res
);
38 res
= tor_process_monitor_new(tor_libevent_get_base(), "44 hello", 0,
42 tor_process_monitor_free(res
);
44 res
= tor_process_monitor_new(tor_libevent_get_base(), "45:hello", 0,
50 tor_process_monitor_free(res
);
53 struct testcase_t procmon_tests
[] = {
54 { "tor_process_monitor_new", test_procmon_tor_process_monitor_new
,
55 TT_FORK
, NULL
, NULL
},