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

Function test_empty

src/tests/unit/logevent.cpp:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace unittest {
27
28std::string test_empty(const Events::Log &ev, const bool expect)
29{
30 bool r = ev.empty();
31 if (expect != r)
32 {
33 return std::string("test_empty(): ")
34 + "ev.empty() = " + (r ? "true" : "false")
35 + " [expected: " + (expect ? "true" : "false") + "]";
36 }
37
38 r = (LogGroup::UNDEFINED == ev.group
39 && LogCategory::UNDEFINED == ev.category
40 && ev.message.empty());
41 if (expect != r)
42 {
43 return std::string("test_empty() - Member check: ")
44 + "(" + std::to_string((unsigned)ev.group) + ", "
45 + std::to_string((unsigned)ev.category) + "', "
46 + "'" + ev.message + "', "
47 + "message.size=" + std::to_string(ev.message.size()) + ") ..."
48 + " is " + (r ? "EMPTY" : "NON-EMPTY")
49 + " [expected: " + (expect ? "EMPTY" : "NON-EMPTY") + "]";
50 }
51 return "";
52};
53
54
55TEST(LogEvent, init_empty)

Callers 1

TESTFunction · 0.70

Calls 2

sizeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected