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

Commit 9e5ba59e authored by Yabin Cui's avatar Yabin Cui
Browse files

Fix no member named 'unique' in 'std::shared_ptr<>'

With clang update, we got the following error:
frameworks/av/media/module/foundation/tests/AData_test.cpp:594:25:
error: no member named 'unique' in 'std::shared_ptr<a
ndroid::DerivedCounter>'
  594 |     EXPECT_TRUE(_shared.unique()); // now only _shared contains the object
      |                 ~~~~~~~ ^

Bug: 342023558
Test: build with clang update
Change-Id: I18f4814d3c288b6e34c78b57ea54ca51e85fc272
parent a4f686d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ TEST_F(ADataTest, AData_CopyMoveTest) {
    EXPECT_EQ(2L, _shared.use_count()); // still both u and _shared contains the object

    EXPECT_TRUE(u.clear());
    EXPECT_TRUE(_shared.unique()); // now only _shared contains the object
    EXPECT_EQ(1L, _shared.use_count()); // now only _shared contains the object

    EXPECT_TRUE(u.set(_constShared));
    EXPECT_EQ(2L, _constShared.use_count()); // even though it is const, we can add a use count
@@ -591,7 +591,7 @@ TEST_F(ADataTest, AData_RelaxedCopyMoveTest) {
    EXPECT_EQ(2L, _shared.use_count()); // still both u and _shared contains the object

    EXPECT_TRUE(u.clear());
    EXPECT_TRUE(_shared.unique()); // now only _shared contains the object
    EXPECT_EQ(1L, _shared.use_count()); // now only _shared contains the object

    EXPECT_TRUE(u.set(_constShared));
    EXPECT_EQ(2L, _constShared.use_count()); // even though it is const, we can add a use count