boost changes the way how it prints boost::system::system_error in
boost 1.79 -- it appends the stringified error_category at end of
exception::what(), and our buffer::malformed_input is a subclass
of boost::system::system_error.
so we cannot just compare the return value of what() with the
expected string, to be more future proof, let's check if i
starts with the expected string instead.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
}
TEST(EncodingException, Macros) {
- for (unsigned i = 0; i < sizeof(expected_what)/sizeof(expected_what[0]); i++) {
+ for (unsigned i = 0; i < std::size(expected_what); i++) {
try {
lame_decoder(i);
} catch (const exception& e) {
- ASSERT_EQ(string(expected_what[i]), string(e.what()));
+ ASSERT_NE(string(e.what()).find(expected_what[i]), string::npos);
}
}
}