Skip to content

Commit

Permalink
more updates, this time local efr32 compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Oct 28, 2024
1 parent a0ec78b commit 8276b4d
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/Span.h>


#include <limits>
#include <optional>

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

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

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

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

0 comments on commit 8276b4d

Please sign in to comment.