Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: tests/cgptlib_test.c

Issue 2719008: Nearly complete rewrite of cgpt tool. (Closed) Base URL: ssh://git@chromiumos-git//vboot_reference.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/Makefile ('k') | tests/common.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/cgptlib_test.c
diff --git a/tests/cgptlib_test.c b/tests/cgptlib_test.c
index 1ab5342afe00bbb25e7d4d80545debb7bfe2a7ba..f016b212fb5fa1529ef08e19932df23d3f965ca8 100644
--- a/tests/cgptlib_test.c
+++ b/tests/cgptlib_test.c
@@ -136,8 +136,8 @@ static void BuildTestGptData(GptData* gpt) {
Memcpy(header->signature, GPT_HEADER_SIGNATURE,
sizeof(GPT_HEADER_SIGNATURE));
header->revision = GPT_HEADER_REVISION;
- header->size = sizeof(GptHeader) - sizeof(header->padding);
- header->reserved = 0;
+ header->size = sizeof(GptHeader);
+ header->reserved_zero = 0;
header->my_lba = 1;
header->alternate_lba = DEFAULT_DRIVE_SECTORS - 1;
header->first_usable_lba = 34;
@@ -157,7 +157,6 @@ static void BuildTestGptData(GptData* gpt) {
Memcpy(&entries[3].type, &chromeos_kernel, sizeof(chromeos_kernel));
entries[3].starting_lba = 334;
entries[3].ending_lba = 430;
- Memset(header->padding, 0, sizeof(header->padding));
/* build secondary */
header2 = (GptHeader*)gpt->secondary_header;
@@ -355,8 +354,8 @@ static int ReservedFieldsTest() {
GptHeader* h2 = (GptHeader*)gpt->secondary_header;
BuildTestGptData(gpt);
- h1->reserved ^= 0x12345678; /* whatever random */
- h2->reserved ^= 0x12345678; /* whatever random */
+ h1->reserved_zero ^= 0x12345678; /* whatever random */
+ h2->reserved_zero ^= 0x12345678; /* whatever random */
RefreshCrc32(gpt);
EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors));
EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors));
« no previous file with comments | « tests/Makefile ('k') | tests/common.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698