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

systemd / systemd / 15512929258

06 Jun 2025 10:28PM UTC coverage: 72.058% (-0.03%) from 72.092%
15512929258

push

github

poettering
nspawn: do basic port to PidRef

THis is sometimes a bit superficial, but in many cases allows us to use
pidfd for various of our operations.

75 of 86 new or added lines in 4 files covered. (87.21%)

3361 existing lines in 68 files now uncovered.

300145 of 416533 relevant lines covered (72.06%)

703207.48 hits per line

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

96.97
/src/test/test-parse-argument.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <signal.h>
4

5
#include "sd-json.h"
6

7
#include "parse-argument.h"
8
#include "path-util.h"
9
#include "stdio-util.h"
10
#include "tests.h"
11

12
TEST(parse_json_argument) {
1✔
13
        sd_json_format_flags_t flags = SD_JSON_FORMAT_PRETTY;
1✔
14

15
        assert_se(parse_json_argument("help", &flags) == 0);
1✔
16
        assert_se(flags == SD_JSON_FORMAT_PRETTY);
1✔
17

18
        assert_se(parse_json_argument("off", &flags) == 1);
1✔
19
        assert_se(flags == SD_JSON_FORMAT_OFF);
1✔
20
}
1✔
21

22
TEST(parse_path_argument) {
1✔
UNCOV
23
        _cleanup_free_ char *path = NULL, *file = NULL;
×
24

25
        assert_se(parse_path_argument("help", false, &path) == 0);
1✔
26
        ASSERT_OK(path_extract_filename(path, &file));
1✔
27
        ASSERT_STREQ(file, "help");
1✔
28

29
        assert_se(parse_path_argument("/", false, &path) == 0);
1✔
30
        ASSERT_STREQ(path, "/");
1✔
31

32
        assert_se(parse_path_argument("/", true, &path) == 0);
1✔
33
        ASSERT_NULL(path);
1✔
34
}
1✔
35

36
TEST(parse_signal_argument) {
1✔
37
        int  signal = -1;
1✔
38

39
        assert_se(parse_signal_argument("help", &signal) == 0);
1✔
40
        assert_se(signal == -1);
1✔
41

42
        assert_se(parse_signal_argument("list", &signal) == 0);
1✔
43
        assert_se(signal == -1);
1✔
44

45
        assert_se(parse_signal_argument("SIGABRT", &signal) == 1);
1✔
46
        assert_se(signal == SIGABRT);
1✔
47

48
        assert_se(parse_signal_argument("ABRT", &signal) == 1);
1✔
49
        assert_se(signal == SIGABRT);
1✔
50

51
        char buf[DECIMAL_STR_MAX(int)];
1✔
52
        xsprintf(buf, "%d", SIGABRT);
1✔
53
        assert_se(parse_signal_argument(buf, &signal) == 1);
1✔
54
        assert_se(signal == SIGABRT);
1✔
55
}
1✔
56

57
DEFINE_TEST_MAIN(LOG_INFO);
1✔
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

© 2026 Coveralls, Inc