From 147d36a5788ff2347de079b185666facbaf9163c Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 5 Feb 2023 21:21:26 +0100 Subject: [PATCH] Improve messages of conversion tests --- tests/conversiontests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/conversiontests.cpp b/tests/conversiontests.cpp index e64ff4b..96abffe 100644 --- a/tests/conversiontests.cpp +++ b/tests/conversiontests.cpp @@ -119,13 +119,13 @@ void ConversionTests::testConversion( stringstream msg; msg << message << '(' << hex << '0' << 'x' << random << ')'; vice(random, m_buff); - CPPUNIT_ASSERT_MESSAGE(msg.str(), versa(m_buff) == random); + CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.str(), random, versa(m_buff)); } #define TEST_TYPE(endianness, function) decltype(endianness::function(m_buff)) #define TEST_CONVERSION(function, endianness) \ - testConversion("testing " #function, \ + testConversion("testing " #endianness "::" #function, \ static_cast(&endianness::getBytes), endianness::function, \ numeric_limits::min(), numeric_limits::max()) @@ -134,8 +134,8 @@ void ConversionTests::testConversion( #define TEST_LE_CONVERSION(function) TEST_CONVERSION(function, LE) #define TEST_CUSTOM_CONVERSION(vice, versa, endianness, min, max) \ - testConversion( \ - "testing " #versa, static_cast(&endianness::vice), endianness::versa, min, max) + testConversion("testing " #versa " (" #endianness ")", \ + static_cast(&endianness::vice), endianness::versa, min, max) /*! * \brief Tests most important binary conversions.