Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1be69051 authored by Bidhya Sharma's avatar Bidhya Sharma Committed by Gerrit Code Review
Browse files

Merge "[Gatt Test] Do not compare padding values"

parents 1475a466 e07690cc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -119,12 +119,15 @@ TEST(GattCacheTest, stored_attribute_to_binary_service_test) {
      /* type*/ 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB,
      /* service uuid */ 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB,
      /* end handle */ 0x1C, 0x00,
      /* cleared padding at end of union*/ 0x00, 0x00};
      /* padding at end of union*/ 0x00, 0x00};
  // clang-format on

  // useful for debugging:
  // LOG(ERROR) << " " << base::HexEncode(&attr, len);
  EXPECT_EQ(memcmp(binary_form, &attr, len), 0);

  // Do not compare last 2 bytes which are padding as
  // x86 can use non-zero padding causing the test to fail
  EXPECT_EQ(memcmp(binary_form, &attr, len - 2), 0);
}

/* This test makes sure that Service represented in StoredAttribute have proper