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

Commit 4644f842 authored by Yifan Hong's avatar Yifan Hong
Browse files

liblp_test_static: GetMockedInstance->GetMockedPropertyFetcher

Rename it to be a better name.
Test: run it

Change-Id: Idcf271e84f8758737a98a4f6c18ea6744b91f79b
parent 94da8944
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ static void ResetPropertyFetcher() {
    IPropertyFetcher::OverrideForTesting(std::make_unique<NiceMock<MockPropertyFetcher>>());
}

MockPropertyFetcher* GetMockedInstance() {
MockPropertyFetcher* GetMockedPropertyFetcher() {
    return static_cast<MockPropertyFetcher*>(IPropertyFetcher::GetInstance());
}

@@ -789,7 +789,7 @@ TEST_F(BuilderTest, ABExtents) {

    // A and B slots should be allocated from separate halves of the partition,
    // to mitigate allocating too many extents. (b/120433288)
    ON_CALL(*GetMockedInstance(), GetProperty("ro.boot.slot_suffix", _))
    ON_CALL(*GetMockedPropertyFetcher(), GetProperty("ro.boot.slot_suffix", _))
            .WillByDefault(Return("_a"));

    auto builder = MetadataBuilder::New(device_info, 65536, 2);
+2 −2
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ TEST(liblp, AutoSlotSuffixing) {
}

TEST(liblp, UpdateRetrofit) {
    ON_CALL(*GetMockedInstance(), GetBoolProperty("ro.boot.dynamic_partitions_retrofit", _))
    ON_CALL(*GetMockedPropertyFetcher(), GetBoolProperty("ro.boot.dynamic_partitions_retrofit", _))
            .WillByDefault(Return(true));

    unique_ptr<MetadataBuilder> builder = CreateDefaultBuilder();
@@ -700,7 +700,7 @@ TEST(liblp, UpdateRetrofit) {
}

TEST(liblp, UpdateNonRetrofit) {
    ON_CALL(*GetMockedInstance(), GetBoolProperty("ro.boot.dynamic_partitions_retrofit", _))
    ON_CALL(*GetMockedPropertyFetcher(), GetBoolProperty("ro.boot.dynamic_partitions_retrofit", _))
            .WillByDefault(Return(false));

    unique_fd fd = CreateFlashedDisk();
+1 −1
Original line number Diff line number Diff line
@@ -44,4 +44,4 @@ class MockPropertyFetcher : public IPropertyFetcher {
}  // namespace fs_mgr
}  // namespace android

android::fs_mgr::MockPropertyFetcher* GetMockedInstance();
android::fs_mgr::MockPropertyFetcher* GetMockedPropertyFetcher();