summaryrefslogtreecommitdiff
path: root/tests/cgptlib_test.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2010-06-03 15:20:19 -0700
committerBill Richardson <wfrichar@chromium.org>2010-06-03 15:20:19 -0700
commit31066a4515824c6d8cf8f69f5cecfb4b508bddba (patch)
treeb250591885058d9eb342eda0296bc524c4c9098a /tests/cgptlib_test.c
parent08dc5f381d2e144428bfc25b0881a435fd1ca155 (diff)
downloadvboot-31066a4515824c6d8cf8f69f5cecfb4b508bddba.tar.gz
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
Diffstat (limited to 'tests/cgptlib_test.c')
-rw-r--r--tests/cgptlib_test.c9
1 files changed, 5 insertions, 4 deletions
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++;