| 24 | namespace unittest { |
| 25 | |
| 26 | std::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 | |
| 52 | TEST(StatusEvent, init_empty) |