core/clock/weekday.c
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /** | ||
| 2 | * @file weekday.c | ||
| 3 | * @brief Weekday names, host-testable off-device. | ||
| 4 | * | ||
| 5 | * @ingroup lib_core | ||
| 6 | */ | ||
| 7 | #include "clock/weekday.h" | ||
| 8 | |||
| 9 | 4 | const char *weekday_short(int wday) | |
| 10 | { | ||
| 11 | // indexed like tm_wday and the phone's base_weekday (0 = Sunday) | ||
| 12 | static const char *const names[7] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; | ||
| 13 |
4/4✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 2 times.
|
4 | if (wday < 0 || wday > 6) |
| 14 | { | ||
| 15 | 2 | return ""; | |
| 16 | } | ||
| 17 | 2 | return names[wday]; | |
| 18 | } | ||
| 19 |