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

Commit f239bf7b authored by cmanton@google.com's avatar cmanton@google.com Committed by Automerger Merge Worker
Browse files

gdx: bt property should use length of properties not bytes am: ac7a2711 am: ba666bb9

parents 34d02126 ba666bb9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class BtPropertyLegacy {
    return const_cast<bt_property_t*>(&properties_[0]);
  }
  int Len() const {
    return static_cast<int>(properties_.size() * sizeof(bt_property_t));
    return static_cast<int>(properties_.size());
  }

 private:
+2 −1
Original line number Diff line number Diff line
@@ -912,7 +912,8 @@ TEST_F(BtPropertyMultiAllocationTest, async_data_multi) {
  for (size_t i = 0; i < kNumThreads; i++) {
    std::vector<std::shared_ptr<BtProperty>> props = future_vector[i].get();
    BtPropertyLegacy legacy(props);
    memcpy(bt_properties[i], (const void*)legacy.Ptr(), (size_t)legacy.Len());
    memcpy(
        bt_properties[i], (const void*)legacy.Ptr(), (size_t)legacy.Len() * sizeof(bt_property_t));

    ASSERT_EQ(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, (int)bt_properties[i]->type);
    ASSERT_EQ((int)sizeof(uint32_t), bt_properties[i]->len);