Line | Branch | Exec | Source |
---|---|---|---|
1 | // SPDX-License-Identifier: LGPL-2.1-or-later | ||
2 | // Copyright (C) 2024 Omar Castro | ||
3 | #include <string.h> | ||
4 | #include "accepted-actions.enum.h" | ||
5 | |||
6 | const char * AcceptedAction_CANCEL_str_value = "cancel"; | ||
7 | const char * AcceptedAction_AUTHENTICATE_str_value = "authenticate"; | ||
8 | |||
9 | 24 | AcceptedAction accepted_action_value_of_str(const char * str){ | |
10 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 23 times.
|
24 | if(str == NULL){ |
11 | 1 | return AcceptedAction_UNKNOWN; | |
12 | } | ||
13 |
3/3✓ Branch 0 taken 4 times.
✓ Branch 1 taken 14 times.
✓ Branch 2 taken 5 times.
|
23 | switch (str[0]) { |
14 | 4 | case 'c': | |
15 | 4 | return strcmp(str, AcceptedAction_CANCEL_str_value) == 0 ? AcceptedAction_CANCEL: AcceptedAction_UNKNOWN; | |
16 | 14 | case 'a': | |
17 |
2/2✓ Branch 0 taken 13 times.
✓ Branch 1 taken 1 times.
|
14 | return strcmp(str, AcceptedAction_AUTHENTICATE_str_value) == 0 ? AcceptedAction_AUTHENTICATE: AcceptedAction_UNKNOWN; |
18 | } | ||
19 | 5 | return AcceptedAction_UNKNOWN; | |
20 | } | ||
21 |