diff options
| author | Yifan Hong <elsk@google.com> | 2019-07-22 18:30:40 -0700 |
|---|---|---|
| committer | Yifan Hong <elsk@google.com> | 2019-07-31 17:43:14 +0000 |
| commit | 012508efa3bb00b5b458caa918f2960653f41df2 (patch) | |
| tree | 80f8fbc7896016b77ecbd8b5828427751cb6101b /boot_control_android_unittest.cc | |
| parent | f9464b4faa1ae76e2c1f8cf2e217e375e93465ad (diff) | |
[REFACTOR] DynamicPartitionControl: minimize API
- Move UpdatePartitionMetadata in boot_control_android.cc to
DynamicPartitionControlAndroid::PreparePartitionsForUpdate to
reflect code ownership better.
- Minimize the API by removing unused functions now that we have
PreparePartitionsForUpdate
- Fix tests: replace MockDynamicPartitionControl to
MockDynamicPartitionControlAndroid because it tests
DynamicPartitionControlAndroid.
Test: unit test
Test: manually apply full OTA
Change-Id: I2959270bd89c4f8ddaa45cf45ba93acdec850f67
Diffstat (limited to 'boot_control_android_unittest.cc')
| -rw-r--r-- | boot_control_android_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/boot_control_android_unittest.cc b/boot_control_android_unittest.cc index 94e195f8..dfcb6fb6 100644 --- a/boot_control_android_unittest.cc +++ b/boot_control_android_unittest.cc @@ -262,7 +262,7 @@ class BootControlAndroidTest : public ::testing::Test { // Fake init bootctl_ bootctl_.module_ = new NiceMock<MockBootControlHal>(); bootctl_.dynamic_control_ = - std::make_unique<NiceMock<MockDynamicPartitionControl>>(); + std::make_unique<NiceMock<MockDynamicPartitionControlAndroid>>(); ON_CALL(module(), getNumberSlots()).WillByDefault(Invoke([] { return kMaxNumSlots; @@ -297,8 +297,8 @@ class BootControlAndroidTest : public ::testing::Test { } // Return the mocked DynamicPartitionControlInterface. - NiceMock<MockDynamicPartitionControl>& dynamicControl() { - return static_cast<NiceMock<MockDynamicPartitionControl>&>( + NiceMock<MockDynamicPartitionControlAndroid>& dynamicControl() { + return static_cast<NiceMock<MockDynamicPartitionControlAndroid>&>( *bootctl_.dynamic_control_); } |
