summaryrefslogtreecommitdiffstats
path: root/fs_mgr/liblp/io_test.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2018-09-24 08:55:17 -0700
committerMark Salyzyn <salyzyn@google.com>2018-09-24 10:20:57 -0700
commit20ff1b203359de4ef6db279524b5978f48cf0e52 (patch)
tree4f5aa972b44bb5238bf84cfd2deb3fbe9838c35c /fs_mgr/liblp/io_test.cpp
parentf86e85cb0afbf2453da1777e79017594cbbe71ae (diff)
downloadsystem_core-20ff1b203359de4ef6db279524b5978f48cf0e52.tar.gz
system_core-20ff1b203359de4ef6db279524b5978f48cf0e52.tar.bz2
system_core-20ff1b203359de4ef6db279524b5978f48cf0e52.zip
liblp: test: fix liblp.UpdateAnyMetadataSlot
Move test to verify we can't read unwritten metadata from liblp.UpdateAnyMetadataSlot to liblp.CreateFakeDisk. Test: gTest liblpg_test Bug: 109821005 Change-Id: I4714c949e2b2d9de6444996a2af2992a821c4a85
Diffstat (limited to 'fs_mgr/liblp/io_test.cpp')
-rw-r--r--fs_mgr/liblp/io_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs_mgr/liblp/io_test.cpp b/fs_mgr/liblp/io_test.cpp
index 329a9016a..eda68fd66 100644
--- a/fs_mgr/liblp/io_test.cpp
+++ b/fs_mgr/liblp/io_test.cpp
@@ -117,6 +117,9 @@ TEST(liblp, CreateFakeDisk) {
uint64_t size;
ASSERT_TRUE(GetDescriptorSize(fd, &size));
ASSERT_EQ(size, kDiskSize);
+
+ // Verify that we can't read unwritten metadata.
+ ASSERT_EQ(ReadMetadata(fd, 1), nullptr);
}
// Flashing metadata should not work if the metadata was created for a larger
@@ -191,9 +194,6 @@ TEST(liblp, UpdateAnyMetadataSlot) {
ASSERT_EQ(imported->partitions.size(), 1);
EXPECT_EQ(GetPartitionName(imported->partitions[0]), "system");
- // Verify that we can't read unwritten metadata.
- ASSERT_EQ(ReadMetadata(fd, 1), nullptr);
-
// Change the name before writing to the next slot.
strncpy(imported->partitions[0].name, "vendor", sizeof(imported->partitions[0].name));
ASSERT_TRUE(UpdatePartitionTable(fd, *imported.get(), 1));