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

Side by Side Diff: src/platform/vboot_reference/tests/cgptlib_test.c

Issue 2606002: Ignore the AlternateLBA field in the GPT headers. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/platform/vboot_reference/utility/cgpt/cgpt_options.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "cgptlib.h" 8 #include "cgptlib.h"
9 #include "cgptlib_internal.h" 9 #include "cgptlib_internal.h"
10 #include "cgptlib_test.h" 10 #include "cgptlib_test.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); 447 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors));
448 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); 448 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors));
449 449
450 BuildTestGptData(gpt); 450 BuildTestGptData(gpt);
451 h1->my_lba = 2; 451 h1->my_lba = 2;
452 h2->my_lba--; 452 h2->my_lba--;
453 RefreshCrc32(gpt); 453 RefreshCrc32(gpt);
454 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); 454 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors));
455 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); 455 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors));
456 456
457 BuildTestGptData(gpt); 457 BuildTestGptData(gpt);
Randall Spangler 2010/06/03 22:04:22 Add a comment that we're explicitly ignoring the a
458 h1->alternate_lba++; 458 h1->alternate_lba++;
459 h2->alternate_lba++; 459 h2->alternate_lba++;
460 RefreshCrc32(gpt); 460 RefreshCrc32(gpt);
461 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); 461 EXPECT(0 == CheckHeader(h1, 0, gpt->drive_sectors));
462 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); 462 EXPECT(0 == CheckHeader(h2, 1, gpt->drive_sectors));
463 463
464 BuildTestGptData(gpt); 464 BuildTestGptData(gpt);
465 h1->alternate_lba--; 465 h1->alternate_lba--;
466 h2->alternate_lba--; 466 h2->alternate_lba--;
467 RefreshCrc32(gpt); 467 RefreshCrc32(gpt);
468 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); 468 EXPECT(0 == CheckHeader(h1, 0, gpt->drive_sectors));
469 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); 469 EXPECT(0 == CheckHeader(h2, 1, gpt->drive_sectors));
470 470
471 BuildTestGptData(gpt); 471 BuildTestGptData(gpt);
472 h1->entries_lba++; 472 h1->entries_lba++;
473 h2->entries_lba++; 473 h2->entries_lba++;
474 RefreshCrc32(gpt); 474 RefreshCrc32(gpt);
475 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors)); 475 EXPECT(1 == CheckHeader(h1, 0, gpt->drive_sectors));
476 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors)); 476 EXPECT(1 == CheckHeader(h2, 1, gpt->drive_sectors));
477 477
478 BuildTestGptData(gpt); 478 BuildTestGptData(gpt);
479 h1->entries_lba--; 479 h1->entries_lba--;
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 printf(COL_RED "The following %d test cases are failed:\n" COL_STOP, 1131 printf(COL_RED "The following %d test cases are failed:\n" COL_STOP,
1132 error_count); 1132 error_count);
1133 for (i = 0; i < sizeof(test_cases)/sizeof(test_cases[0]); ++i) { 1133 for (i = 0; i < sizeof(test_cases)/sizeof(test_cases[0]); ++i) {
1134 if (test_cases[i].retval) 1134 if (test_cases[i].retval)
1135 printf(" %s()\n", test_cases[i].name); 1135 printf(" %s()\n", test_cases[i].name);
1136 } 1136 }
1137 } 1137 }
1138 1138
1139 return (error_count) ? 1 : 0; 1139 return (error_count) ? 1 : 0;
1140 } 1140 }
OLDNEW
« no previous file with comments | « no previous file | src/platform/vboot_reference/utility/cgpt/cgpt_options.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698