diff options
author | Randall Spangler <rspangler@chromium.org> | 2010-09-07 10:30:50 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2010-09-07 10:30:50 -0700 |
commit | 2c21fe6693480e437ccedd03f32cda135cd11c68 (patch) | |
tree | b6ca9be006ac9d2072c232047154459c5f8ebf1e /tests/cgptlib_test.c | |
parent | 9828594eaace7d218a6230e0747ba27f0ed9b483 (diff) | |
download | vboot-2c21fe6693480e437ccedd03f32cda135cd11c68.tar.gz |
Successful partitions are never marked bad by cgptlib.
Change-Id: I70e54f59b540e9115bb6bd77ae51f49a1f4ab671
BUG=chromeos-partner:1029
TEST=make && make runtests
Review URL: http://codereview.chromium.org/3315014
Diffstat (limited to 'tests/cgptlib_test.c')
-rw-r--r-- | tests/cgptlib_test.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/cgptlib_test.c b/tests/cgptlib_test.c index 891d53b7..791815e9 100644 --- a/tests/cgptlib_test.c +++ b/tests/cgptlib_test.c @@ -1068,17 +1068,12 @@ static int GptUpdateTest() { EXPECT(4 == GetEntryPriority(e + KERNEL_A)); EXPECT(0 == GetEntryTries(e + KERNEL_A)); EXPECT(0 == gpt->modified); - /* Marking it bad does, though */ + /* Marking it bad also does not update it. */ EXPECT(GPT_SUCCESS == GptUpdateKernelEntry(gpt, GPT_UPDATE_ENTRY_BAD)); - EXPECT(0 == GetEntrySuccessful(e + KERNEL_A)); - EXPECT(0 == GetEntryPriority(e + KERNEL_A)); + EXPECT(1 == GetEntrySuccessful(e + KERNEL_A)); + EXPECT(4 == GetEntryPriority(e + KERNEL_A)); EXPECT(0 == GetEntryTries(e + KERNEL_A)); - /* Which affects both copies of the partition entries */ - EXPECT(0 == GetEntrySuccessful(e2 + KERNEL_A)); - EXPECT(0 == GetEntryPriority(e2 + KERNEL_A)); - EXPECT(0 == GetEntryTries(e2 + KERNEL_A)); - /* And that's caused the GPT to need updating */ - EXPECT(0x0F == gpt->modified); + EXPECT(0 == gpt->modified); /* Kernel with tries */ EXPECT(GPT_SUCCESS == GptNextKernelEntry(gpt, &start, &size)); @@ -1091,6 +1086,12 @@ static int GptUpdateTest() { EXPECT(0 == GetEntrySuccessful(e + KERNEL_B)); EXPECT(0 == GetEntryPriority(e + KERNEL_B)); EXPECT(0 == GetEntryTries(e + KERNEL_B)); + /* Which affects both copies of the partition entries */ + EXPECT(0 == GetEntrySuccessful(e2 + KERNEL_B)); + EXPECT(0 == GetEntryPriority(e2 + KERNEL_B)); + EXPECT(0 == GetEntryTries(e2 + KERNEL_B)); + /* And that's caused the GPT to need updating */ + EXPECT(0x0F == gpt->modified); /* Another kernel with tries */ EXPECT(GPT_SUCCESS == GptNextKernelEntry(gpt, &start, &size)); |