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

mendersoftware / mender / 1054626264

30 Oct 2023 10:27AM UTC coverage: 80.137% (-0.06%) from 80.194%
1054626264

push

gitlab-ci

kacf
chore: Add many missing error checks and exception harnesses.

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

100 of 100 new or added lines in 7 files covered. (100.0%)

6887 of 8594 relevant lines covered (80.14%)

9361.04 hits per line

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

71.43
/common/identity_parser/identity_parser.cpp
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
#include <common/identity_parser.hpp>
16

17
#include <common/key_value_parser.hpp>
18
#include <common/processes.hpp>
19

20
namespace mender {
21
namespace common {
22
namespace identity_parser {
23

24
using namespace std;
25
namespace kvp = mender::common::key_value_parser;
26
namespace procs = mender::common::processes;
27

28
kvp::ExpectedKeyValuesMap GetIdentityData(const string &identity_data_generator) {
7✔
29
        procs::Process proc({identity_data_generator});
35✔
30
        auto ex_line_data = proc.GenerateLineData();
7✔
31
        if (!ex_line_data) {
7✔
32
                return expected::unexpected(
×
33
                        ex_line_data.error().WithContext("While getting identity data"));
×
34
        }
35

36
        auto ex_key_values = kvp::ParseKeyValues(ex_line_data.value());
7✔
37
        return ex_key_values;
38
}
39

40
} // namespace identity_parser
41
} // namespace common
42
} // namespace mender
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