| 21 | |
| 22 | |
| 23 | bool 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 | |
| 63 | int test1() |