summaryrefslogtreecommitdiff
path: root/tests/cgptlib_test.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2010-06-11 09:15:55 -0700
committerBill Richardson <wfrichar@chromium.org>2010-06-11 09:15:55 -0700
commitf1372d9109d638fbb1a177a89ebaf64e7ee0637e (patch)
tree243cdacbc1028e6a987d582d33927560af0b47e0 /tests/cgptlib_test.c
parent6a97b3e2a1bee35bf3c00f2fb0faafde4aaab9e2 (diff)
downloadvboot-f1372d9109d638fbb1a177a89ebaf64e7ee0637e.tar.gz
Nearly complete rewrite of cgpt tool.
This fixes a number of bugs, adds a bunch of commands, and essentially makes cgpt ready to use as a replacement for gpt. Still to do is to add commands and options that will let it generated intentionally bad partitions, for use in testing. Review URL: http://codereview.chromium.org/2719008
Diffstat (limited to 'tests/cgptlib_test.c')
-rw-r--r--tests/cgptlib_test.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/cgptlib_test.c b/tests/cgptlib_test.c
index 1ab5342a..f016b212 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));