From d1aa4aa6fb65721cfba48092c3703514a4d73a27 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Fri, 8 Mar 2024 01:05:12 +0100 Subject: [PATCH] core: fix test in Apple clang 15.0.0 (Xcode 15.3) --- .../test/attribute-container-test-suite.cc | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/core/test/attribute-container-test-suite.cc b/src/core/test/attribute-container-test-suite.cc index d8a191ac7..fa0359319 100644 --- a/src/core/test/attribute-container-test-suite.cc +++ b/src/core/test/attribute-container-test-suite.cc @@ -193,22 +193,6 @@ AttributeContainerObject::GetIntVec() const return m_intvec; } -/** - * \ingroup attribute-tests - * - * This function handles mixed constness and compatible, yet - * distinct numerical classes (like int and long) - * \param x The left operand. - * \param y The right operand. - * \return true if the pairs have the same numerical values. - */ -template -bool -operator==(const std::pair& x, const std::pair& y) -{ - return x.first == y.first && x.second == y.second; -} - /** * \ingroup attribute-tests * @@ -307,7 +291,9 @@ AttributeContainerTestCase::DoRun() for (const auto& v : ref) { NS_TEST_ASSERT_MSG_NE(true, (aciter == ac.End()), "AC iterator reached end"); - NS_TEST_ASSERT_MSG_EQ(v, (*aciter)->Get(), "Incorrect value"); + bool valCheck = + v.first == (*aciter)->Get().first && v.second == (*aciter)->Get().second; + NS_TEST_ASSERT_MSG_EQ(valCheck, true, "Incorrect value"); ++aciter; } NS_TEST_ASSERT_MSG_EQ(true, (aciter == ac.End()), "AC iterator did not reach end"); @@ -542,7 +528,8 @@ AttributeContainerSetGetTestCase::DoRun() auto iter = map.begin(); for (const auto& v : mapstrint) { - NS_TEST_ASSERT_MSG_EQ(v, *iter, "Incorrect value in mapstrint"); + bool valCheck = v.first == (*iter).first && v.second == (*iter).second; + NS_TEST_ASSERT_MSG_EQ(valCheck, true, "Incorrect value in mapstrint"); ++iter; } }