From 5a2681f337fe3607b7ab64fa00a4298f359941b3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 28 Oct 2024 11:30:52 -0400 Subject: [PATCH] Another try to make efr32 build of tests happy --- .../tests/TestEmberAttributeDataBuffer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/codegen-data-model-provider/tests/TestEmberAttributeDataBuffer.cpp b/src/app/codegen-data-model-provider/tests/TestEmberAttributeDataBuffer.cpp index 438e35b427515c..4dfa3d97740340 100644 --- a/src/app/codegen-data-model-provider/tests/TestEmberAttributeDataBuffer.cpp +++ b/src/app/codegen-data-model-provider/tests/TestEmberAttributeDataBuffer.cpp @@ -37,7 +37,6 @@ #include -#include #include #include @@ -114,7 +113,7 @@ template <> bool IsEqual(const float & a, const float & b) { - if (std::isnan(a) && std::isnan(b)) + if (isnan(a) && isnan(b)) { return true; } @@ -126,7 +125,7 @@ template <> bool IsEqual(const double & a, const double & b) { - if (std::isnan(a) && std::isnan(b)) + if (isnan(a) && isnan(b)) { return true; } @@ -1157,7 +1156,7 @@ TEST(TestEmberAttributeBuffer, TestDecodeFloatingPoint) { EncodeTester tester(CreateFakeMeta(ZCL_SINGLE_ATTRIBUTE_TYPE, false /* nullable */)); // non-nullable float - EXPECT_TRUE(tester.TryDecode(std::nan("0"), { 0, 0, 0xC0, 0x7F }).IsSuccess()); + EXPECT_TRUE(tester.TryDecode(NAN, { 0, 0, 0xC0, 0x7F }).IsSuccess()); } { @@ -1177,6 +1176,6 @@ TEST(TestEmberAttributeBuffer, TestDecodeFloatingPoint) { EncodeTester tester(CreateFakeMeta(ZCL_DOUBLE_ATTRIBUTE_TYPE, false /* nullable */)); // non-nullable double - EXPECT_TRUE(tester.TryDecode(std::nan("0"), { 0, 0, 0, 0, 0, 0, 0xF8, 0x7F }).IsSuccess()); + EXPECT_TRUE(tester.TryDecode(NAN, { 0, 0, 0, 0, 0, 0, 0xF8, 0x7F }).IsSuccess()); } }