MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / test_empty

Function test_empty

src/tests/dbus/statusevent-selftest.cpp:23–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23bool test_empty(const Events::Status &ev, const bool expect)
24{
25 bool ret = false;
26
27
28 bool r = ev.empty();
29 std::cout << " test_empty(): ev.empty() = " << r << " ... ";
30 if (expect != r)
31 {
32 std::cerr << "** ERROR ** Object not empty [empty()]: " << std::endl;
33 ret = true;
34 }
35 else
36 {
37 std::cout << "PASSED" << std::endl;
38 }
39
40
41
42 r = (StatusMajor::UNSET == ev.major
43 && StatusMinor::UNSET == ev.minor
44 && ev.message.empty());
45 std::cout << " test_empty(): Element check:"
46 << " (" << std::to_string((unsigned)ev.major)
47 << ", " << std::to_string((unsigned)ev.minor)
48 << ", '" << ev.message << "') = " << r << " ... ";
49 if (expect != r)
50 {
51 std::cerr << "** ERROR ** Object not empty [direct member check]"
52 << std::endl;
53 ret = false;
54 }
55 else
56 {
57 std::cout << "PASSED" << std::endl;
58 }
59 return ret;
60};
61
62
63int test1()

Callers 1

test1Function · 0.70

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected