[REFACTOR] DynamicPartitionControl: Add GetSuperPartitionName
fs_mgr_get_super_partition_name() should be mocked because
it is an external dependency to libfs_mgr.
In tests, deliberately make GetSuperDevice() to return "fake_super"
instead of "super" to make sure it is mocked properly.
Test: run unittests
Test: manually apply OTA
Change-Id: I0f05d99bf168b6e658052b4bd67dc1e82ab36471
diff --git a/boot_control_android_unittest.cc b/boot_control_android_unittest.cc
index 1a87547..6f02a07 100644
--- a/boot_control_android_unittest.cc
+++ b/boot_control_android_unittest.cc
@@ -73,6 +73,13 @@
*device = GetDmDevice(partition_name_suffix);
return true;
}));
+
+ ON_CALL(dynamicControl(), GetSuperPartitionName(_))
+ .WillByDefault(Return(kFakeSuper));
+ }
+
+ std::string GetSuperDevice(uint32_t slot) {
+ return GetDevice(dynamicControl().GetSuperPartitionName(slot));
}
// Return the mocked HAL module.