• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 1022567176

02 Oct 2023 07:50AM UTC coverage: 80.127% (+2.5%) from 77.645%
1022567176

push

gitlab-ci

kacf
chore: Centralize selection of `std::filesystem` library.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>

6447 of 8046 relevant lines covered (80.13%)

9912.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/mender-update/daemon/state_events.hpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#ifndef MENDER_UPDATE_STATE_EVENTS_HPP
16
#define MENDER_UPDATE_STATE_EVENTS_HPP
17

18
namespace mender {
19
namespace update {
20
namespace daemon {
21

22
enum class StateEvent {
23
        Started,
24
        AlwaysSuccess,
25
        Success,
26
        Failure,
27
        NothingToDo,
28
        Retry,
29
        InventoryPollingTriggered,
30
        DeploymentPollingTriggered,
31
        StateLoopDetected,
32
        DeploymentStarted,
33
        DeploymentEnded,
34
        RollbackStarted,
35
};
36

37
inline std::string StateEventToString(const StateEvent &event) {
×
38
        switch (event) {
×
39
        case StateEvent::Started:
40
                return "Started";
×
41
        case StateEvent::AlwaysSuccess:
42
                return "AlwaysSuccess";
×
43
        case StateEvent::Success:
44
                return "Success";
×
45
        case StateEvent::Failure:
46
                return "Failure";
×
47
        case StateEvent::NothingToDo:
48
                return "NothingToDo";
×
49
        case StateEvent::Retry:
50
                return "Retry";
×
51
        case StateEvent::InventoryPollingTriggered:
52
                return "InventoryPollingTriggered";
×
53
        case StateEvent::DeploymentPollingTriggered:
54
                return "DeploymentPollingTriggered";
×
55
        case StateEvent::StateLoopDetected:
56
                return "StateLoopDetected";
×
57
        case StateEvent::DeploymentStarted:
58
                return "DeploymentStarted";
×
59
        case StateEvent::DeploymentEnded:
60
                return "DeploymentEnded";
×
61
        case StateEvent::RollbackStarted:
62
                return "RollbackStarted";
×
63
        }
64
        assert(false);
65
        return "MissingStateInSwitchStatement";
×
66
}
67

68
} // namespace daemon
69
} // namespace update
70
} // namespace mender
71

72
#endif // MENDER_UPDATE_STATE_EVENTS_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc