Skip to content

Commit

Permalink
Another try to make efr32 build of tests happy
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Oct 28, 2024
1 parent 3d364fa commit 5a2681f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#include <math.h>

#include <cmath>
#include <limits>
#include <optional>

Expand Down Expand Up @@ -114,7 +113,7 @@ template <>
bool IsEqual<float>(const float & a, const float & b)
{

if (std::isnan(a) && std::isnan(b))
if (isnan(a) && isnan(b))
{
return true;
}
Expand All @@ -126,7 +125,7 @@ template <>
bool IsEqual<double>(const double & a, const double & b)
{

if (std::isnan(a) && std::isnan(b))
if (isnan(a) && isnan(b))
{
return true;
}
Expand Down Expand Up @@ -1157,7 +1156,7 @@ TEST(TestEmberAttributeBuffer, TestDecodeFloatingPoint)
{
EncodeTester tester(CreateFakeMeta(ZCL_SINGLE_ATTRIBUTE_TYPE, false /* nullable */));
// non-nullable float
EXPECT_TRUE(tester.TryDecode<float>(std::nan("0"), { 0, 0, 0xC0, 0x7F }).IsSuccess());
EXPECT_TRUE(tester.TryDecode<float>(NAN, { 0, 0, 0xC0, 0x7F }).IsSuccess());
}

{
Expand All @@ -1177,6 +1176,6 @@ TEST(TestEmberAttributeBuffer, TestDecodeFloatingPoint)
{
EncodeTester tester(CreateFakeMeta(ZCL_DOUBLE_ATTRIBUTE_TYPE, false /* nullable */));
// non-nullable double
EXPECT_TRUE(tester.TryDecode<double>(std::nan("0"), { 0, 0, 0, 0, 0, 0, 0xF8, 0x7F }).IsSuccess());
EXPECT_TRUE(tester.TryDecode<double>(NAN, { 0, 0, 0, 0, 0, 0, 0xF8, 0x7F }).IsSuccess());
}
}

0 comments on commit 5a2681f

Please sign in to comment.