summaryrefslogtreecommitdiff
path: root/dynamic_partition_test_utils.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2019-07-23 20:49:16 -0700
committerYifan Hong <elsk@google.com>2019-07-31 17:43:14 +0000
commit700d7c1194a0606454f53cef6ad4e457960402ea (patch)
treee2bf4923e79473517f84b247d346478d900fe1eb /dynamic_partition_test_utils.h
parentc049f93549c6dedef00ac73c5b19f2b875e796e1 (diff)
[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
Diffstat (limited to 'dynamic_partition_test_utils.h')
-rw-r--r--dynamic_partition_test_utils.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/dynamic_partition_test_utils.h b/dynamic_partition_test_utils.h
index 2cfdff5d..574d30e8 100644
--- a/dynamic_partition_test_utils.h
+++ b/dynamic_partition_test_utils.h
@@ -48,6 +48,7 @@ constexpr const char* kFakeDevicePath = "/fake/dev/path/";
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 @@ inline std::string GetDmDevice(const std::string& name) {
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(