| 40 | } |
| 41 | |
| 42 | void throwOnWrongMessage(StatsdServer& server, const std::string& expected) { |
| 43 | auto actual = server.receive(); |
| 44 | if (actual != expected) { |
| 45 | std::cerr << "Expected: " << expected << " but got: " << actual << std::endl; |
| 46 | throw std::runtime_error("Incorrect stat received"); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void testErrorConditions() { |
| 51 | // Resolve a rubbish ip and make sure initialization failed |
no test coverage detected