From 31066a4515824c6d8cf8f69f5cecfb4b508bddba Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 3 Jun 2010 15:20:19 -0700 Subject: Ignore the AlternateLBA field in the GPT headers. We know where to look, and we'll look there regardless. We don't care where the header creator thinks it should be. Update tests to match. Oh, and don't assume that I mean "/dev/FOO" if I just say "FOO". That's really annoying. Review URL: http://codereview.chromium.org/2606002 --- tests/cgptlib_test.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/cgptlib_test.c') diff --git a/tests/cgptlib_test.c b/tests/cgptlib_test.c index 80dc264d..1ab5342a 100644 --- a/tests/cgptlib_test.c +++ b/tests/cgptlib_test.c @@ -454,19 +454,20 @@ static int MyLbaTest() { EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); + /* We should ignore the alternate_lba field entirely */ BuildTestGptData(gpt); h1->alternate_lba++; h2->alternate_lba++; RefreshCrc32(gpt); - EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); - EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); + EXPECT(0 == CheckHeader(h1, 0, gpt->drive_sectors)); + EXPECT(0 == CheckHeader(h2, 1, gpt->drive_sectors)); BuildTestGptData(gpt); h1->alternate_lba--; h2->alternate_lba--; RefreshCrc32(gpt); - EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); - EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); + EXPECT(0 == CheckHeader(h1, 0, gpt->drive_sectors)); + EXPECT(0 == CheckHeader(h2, 1, gpt->drive_sectors)); BuildTestGptData(gpt); h1->entries_lba++; -- cgit v1.2.1