vboot: GPT interface cleanup
- Rename drive_sectors to streaming_drive_sectors, to contrast with
gpt_drive_sectors
- Replace stored_on_device field with flags field for future
extensibility
BUG=chromium:433433
TEST=make runtests
BRANCH=none
Change-Id: I785a3b735b8eb96f647a334659329db3ee43eb80
Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/234283
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c
index c546ed1..6f47ae3 100644
--- a/tests/vboot_kernel_tests.c
+++ b/tests/vboot_kernel_tests.c
@@ -289,7 +289,7 @@
GptHeader *h;
g.sector_bytes = MOCK_SECTOR_SIZE;
- g.drive_sectors = g.gpt_drive_sectors = MOCK_SECTOR_COUNT;
+ g.streaming_drive_sectors = g.gpt_drive_sectors = MOCK_SECTOR_COUNT;
g.valid_headers = g.valid_entries = MASK_BOTH;
ResetMocks();
@@ -315,11 +315,11 @@
Memset(mock_gpt_primary, '\0', sizeof(*mock_gpt_primary));
TEST_EQ(AllocAndReadGptData(handle, &g), 0,
"AllocAndRead primary invalid");
- TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
1, "Primary header is invalid");
- TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
0, "Secondary header is valid");
TEST_CALLS("VbExDiskRead(h, 1, 1)\n"
"VbExDiskRead(h, 1023, 1)\n"
@@ -334,11 +334,11 @@
Memset(mock_gpt_secondary, '\0', sizeof(*mock_gpt_secondary));
TEST_EQ(AllocAndReadGptData(handle, &g), 0,
"AllocAndRead secondary invalid");
- TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
0, "Primary header is valid");
- TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
1, "Secondary header is invalid");
TEST_CALLS("VbExDiskRead(h, 1, 1)\n"
"VbExDiskRead(h, 2, 32)\n"
@@ -354,11 +354,11 @@
Memset(mock_gpt_secondary, '\0', sizeof(*mock_gpt_secondary));
TEST_EQ(AllocAndReadGptData(handle, &g), 1,
"AllocAndRead primary and secondary invalid");
- TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
1, "Primary header is invalid");
- TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
1, "Secondary header is invalid");
TEST_CALLS("VbExDiskRead(h, 1, 1)\n"
"VbExDiskRead(h, 1023, 1)\n");
@@ -385,8 +385,8 @@
"VbExDiskRead(h, 991, 32)\n"
"VbExDiskWrite(h, 1, 1)\n"
"VbExDiskWrite(h, 2, 32)\n");
- TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_primary, 0, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
0, "Fix Primary GPT: Primary header is valid");
/*
@@ -410,8 +410,8 @@
"VbExDiskRead(h, 1023, 1)\n"
"VbExDiskWrite(h, 1023, 1)\n"
"VbExDiskWrite(h, 991, 32)\n");
- TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.drive_sectors,
- g.gpt_drive_sectors, GPT_STORED_ON_DEVICE),
+ TEST_EQ(CheckHeader(mock_gpt_secondary, 1, g.streaming_drive_sectors,
+ g.gpt_drive_sectors, 0),
0, "Fix Secondary GPT: Secondary header is valid");
/* Data which is changed is written */