[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/dynamic_partition_test_utils.h b/dynamic_partition_test_utils.h
index 2cfdff5..574d30e 100644
--- a/dynamic_partition_test_utils.h
+++ b/dynamic_partition_test_utils.h
@@ -48,6 +48,7 @@
constexpr const char* kFakeDmDevicePath = "/fake/dm/dev/path/";
constexpr const uint32_t kFakeMetadataSize = 65536;
constexpr const char* kDefaultGroup = "foo";
+constexpr const char* kFakeSuper = "fake_super";
// A map describing the size of each partition.
// "{name, size}"
@@ -121,11 +122,6 @@
return kFakeDmDevicePath + name;
}
-// TODO(elsk): fs_mgr_get_super_partition_name should be mocked.
-inline std::string GetSuperDevice(uint32_t slot) {
- return GetDevice(fs_mgr_get_super_partition_name(slot));
-}
-
// To support legacy tests, auto-convert {name_a: size} map to
// PartitionMetadata.
inline PartitionMetadata PartitionSuffixSizesToMetadata(