Host C Specs


Directory: src/c/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 6 / 0 / 6
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 8 / 0 / 8

core/role/role.c
Line Branch Exec Source
1 /**
2 * @file role.c
3 * @brief The order the day, night, and Quiet Time triggers are asked in.
4 *
5 * @ingroup lib_core
6 */
7 #include "role.h"
8
9 7 Role role_pick(bool quiet_on, bool quiet_set, bool night_on, bool night_set)
10 {
11
4/4
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 2 times.
7 if (quiet_on && quiet_set)
12 {
13 2 return ROLE_QUIET;
14 }
15
16
4/4
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 2 times.
5 if (night_on && night_set)
17 {
18 2 return ROLE_NIGHT;
19 }
20
21 3 return ROLE_DAY;
22 }
23