| 88 | } |
| 89 | |
| 90 | template <class T> static void assert_equals(const T & expected, const T & actual) { |
| 91 | if (!equals(expected, actual)) { |
| 92 | std::ostringstream oss_expected; |
| 93 | oss_expected << expected; |
| 94 | std::ostringstream oss_actual; |
| 95 | oss_actual << actual; |
| 96 | LOG_ERR("Expected: %s\n", oss_expected.str().c_str()); |
| 97 | LOG_ERR("Actual: %s\n", oss_actual.str().c_str()); |
| 98 | common_log_flush(common_log_main()); |
| 99 | throw std::runtime_error("Test failed"); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | static std::string read_file(const std::string & path) { |
| 104 | std::ifstream fs(path, std::ios_base::binary); |
no test coverage detected