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

Function test_empty

src/tests/unit/statusevent.cpp:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace unittest {
25
26std::string test_empty(const Events::Status &ev, const bool expect)
27{
28 bool r = ev.empty();
29 if (expect != r)
30 {
31 return std::string("test_empty(): ")
32 + "ev.empty() = " + (r ? "true" : "false")
33 + " [expected: " + (expect ? "true" : "false") + "]";
34 }
35
36 r = (StatusMajor::UNSET == ev.major
37 && StatusMinor::UNSET == ev.minor
38 && ev.message.empty());
39 if (expect != r)
40 {
41 return std::string("test_empty() - Member check: ")
42 + "(" + std::to_string((unsigned)ev.major) + ", "
43 + std::to_string((unsigned)ev.minor) + "', "
44 + "message.size=" + std::to_string(ev.message.size()) + ") ..."
45 + " is " + (r ? "EMPTY" : "NON-EMPTY")
46 + " [expected: " + (expect ? "EMPTY" : "NON-EMPTY") + "]";
47 }
48 return "";
49};
50
51
52TEST(StatusEvent, init_empty)

Callers 1

TESTFunction · 0.70

Calls 2

sizeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected