mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
More cgptlib tests
Add some extra cases to SanityCheckTest() to test both header and entries being garbled at either end of the disk. Add DuplicateUniqueGuidTest() to check that GPTs having duplicate UniqueGuids in the entries are rejected. We can only check this per-disk, of course. Made some changes to the library to enforce the UniqueGuid requirement that I just started testing for. BUG=chromium-os:4854 Review URL: http://codereview.chromium.org/3135044 Change-Id: I86458faf9cc99aa3f29aac0d5b144dbd05067181
This commit is contained in:
@@ -152,6 +152,10 @@ int CheckEntries(GptEntry* entries, GptHeader* h) {
|
||||
if ((entry->ending_lba >= e2->starting_lba) &&
|
||||
(entry->ending_lba <= e2->ending_lba))
|
||||
return 1;
|
||||
|
||||
/* UniqueGuid field must be unique. */
|
||||
if (0 == Memcmp(&entry->unique, &e2->unique, sizeof(Guid)))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user