diff --git a/tests/unit/tests_high_five_base.cpp b/tests/unit/tests_high_five_base.cpp index 5cd0554e4..20e8efdaa 100644 --- a/tests/unit/tests_high_five_base.cpp +++ b/tests/unit/tests_high_five_base.cpp @@ -2945,9 +2945,16 @@ TEST_CASE("HighFiveReadType") { TEST_CASE("DirectWriteBool") { SECTION("Basic compatibility") { using IntType = typename std::underlying_type::type; + + details::Boolean true_value = details::Boolean::HighFiveTrue; + IntType const* const true_ptr = static_cast((void*) &true_value); + + details::Boolean false_value = details::Boolean::HighFiveFalse; + IntType const* const false_ptr = static_cast((void*) &false_value); + CHECK(sizeof(bool) == sizeof(details::Boolean)); - CHECK(true == static_cast(details::Boolean::HighFiveTrue)); - CHECK(false == static_cast(details::Boolean::HighFiveFalse)); + CHECK(*true_ptr == static_cast(details::Boolean::HighFiveTrue)); + CHECK(*false_ptr == static_cast(details::Boolean::HighFiveFalse)); } auto file = File("rw_bool_from_ptr.h5", File::Truncate);