This source file includes following definitions.
- pcmk__effective_rc_test
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13 #include <crm/common/agents.h>
14
15 static void
16 pcmk__effective_rc_test(void **state) {
17
18
19
20 assert_int_equal(PCMK_OCF_OK, pcmk__effective_rc(PCMK_OCF_OK));
21 assert_int_equal(PCMK_OCF_OK, pcmk__effective_rc(PCMK_OCF_DEGRADED));
22 assert_int_equal(PCMK_OCF_RUNNING_PROMOTED, pcmk__effective_rc(PCMK_OCF_DEGRADED_PROMOTED));
23 assert_int_equal(PCMK_OCF_UNKNOWN, pcmk__effective_rc(PCMK_OCF_UNKNOWN));
24
25
26
27
28
29 assert_int_equal(-1, pcmk__effective_rc(-1));
30 assert_int_equal(255, pcmk__effective_rc(255));
31 assert_int_equal(INT_MAX, pcmk__effective_rc(INT_MAX));
32 assert_int_equal(INT_MIN, pcmk__effective_rc(INT_MIN));
33 }
34
35 PCMK__UNIT_TEST(NULL, NULL,
36 cmocka_unit_test(pcmk__effective_rc_test))