diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index 403930c483..5ce179729d 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,5 +1,10 @@ \page changelog Change Log +# Version 2.13.7: UNRELEASED +- BUG FIXES: + - Fix incorrect check in mrpt-io unit tests leading to potential false positives. + + # Version 2.13.6: Released Aug 14th, 2024 - Build system: - This main MRPT repository is no longer directly built as a ROS package. Please, use the wrappers for better modularity: diff --git a/libs/io/src/CFileGZStreams_unittest.cpp b/libs/io/src/CFileGZStreams_unittest.cpp index a2f6dfa78b..a0d9c7804a 100644 --- a/libs/io/src/CFileGZStreams_unittest.cpp +++ b/libs/io/src/CFileGZStreams_unittest.cpp @@ -16,6 +16,23 @@ #include #include // std::equal +#include +#include +#include +#include + +namespace +{ +std::string to_hex_string(const uint8_t* buf, size_t len) +{ + std::ostringstream oss; + for (size_t i = 0; i < len; ++i) + { + oss << std::hex << std::setw(2) << std::setfill('0') << static_cast(buf[i]); + } + return oss.str(); +} +} // namespace const size_t tst_data_len = 1000U; @@ -112,7 +129,10 @@ TEST(CFileGZStreams, readwriteTmpFileCompressed) const size_t rd_count = fil_in.Read(rd_buf, tst_data_len / 4); EXPECT_EQ(rd_count, tst_data_len / 4); - EXPECT_TRUE(std::equal(std::begin(tst_data), std::end(tst_data), std::begin(rd_buf))); + EXPECT_TRUE(std::equal(std::begin(rd_buf), std::end(rd_buf), std::begin(tst_data))) + << " compress_level: " << compress_level << "\n" + << " test_data: " << to_hex_string(tst_data.data(), tst_data.size()) << "\n" + << " read_data: " << to_hex_string(rd_buf, sizeof(rd_buf)) << "\n"; // next I should find an EOF: const auto rdEof = fil_in.Read(rd_buf, 1);