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

Unified Diff: tests/cgptlib_test.c

Issue 3315014: Successful partitions are never marked bad by cgptlib. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Created 10 years, 3 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
« firmware/lib/cgptlib/cgptlib.c ('K') | « firmware/version.c ('k') | no next file » | 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 891d53b72a93dcf2bf013e3dc217ff47c1082a68..791815e907d6325ca36784149b47a4c3c3bd3a32 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));
« firmware/lib/cgptlib/cgptlib.c ('K') | « firmware/version.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698