Skip to content

Commit

Permalink
Merge branch 'post_merge_cleanup_36229_ember_buffer_encode' into defa…
Browse files Browse the repository at this point in the history
…ult_enable_dm_provider
  • Loading branch information
andy31415 committed Oct 28, 2024
2 parents 4a2aa86 + 8276b4d commit b43b80b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
#include <pw_unit_test/framework.h>

#include <cmath>

#include <app/codegen-data-model-provider/EmberAttributeDataBuffer.h>

#include <app-common/zap-generated/attribute-type.h>
Expand All @@ -35,9 +37,6 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/Span.h>

#include <math.h>

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

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

if (std::isnan(a) && std::isnan(b))
{
return true;
Expand All @@ -125,7 +123,6 @@ bool IsEqual<float>(const float & a, const float & b)
template <>
bool IsEqual<double>(const double & a, const double & 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>(std::nan("0"), { 0, 0, 0xC0, 0x7F }).IsSuccess());
EXPECT_TRUE(tester.TryDecode<float>(std::nanf("0"), { 0, 0, 0xC0, 0x7F }).IsSuccess());
}

{
Expand Down

0 comments on commit b43b80b

Please sign in to comment.