[Zucchini] Format change: PatchElementHeader: Group fields by "old" and "new".
Previously PatchElementHeader members were ordered by:
[old_offset, new_offset, old_length, new_length].
This CL changes the order to
[old_offset, old_length, new_offset, new_length]
to be consistent with PatchHeader's grouping by "old" and "new".
Also improve comments in patch_read_write_unittest.cc, and fix
input value in PatchElementTest.WrongExtraData.
Change-Id: I0dab56b7de1ba99f0a2f686dfebdf422a9d1c3b0
Reviewed-on: https://chromium-review.googlesource.com/1043073
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556076}
NOKEYCHECK=True
GitOrigin-RevId: cfb444ca0a5d494fc7e7beb74b0481249249671a
diff --git a/patch_utils.h b/patch_utils.h
index b904380..5f49195 100644
--- a/patch_utils.h
+++ b/patch_utils.h
@@ -34,20 +34,20 @@
};
// Sanity check.
-static_assert(sizeof(PatchHeader) == 20, "PatchHeader is 20 bytes");
+static_assert(sizeof(PatchHeader) == 20, "PatchHeader must be 20 bytes");
// Header for a patch element, found at the beginning of every patch element.
struct PatchElementHeader {
uint32_t old_offset;
- uint32_t new_offset;
uint32_t old_length;
+ uint32_t new_offset;
uint32_t new_length;
- uint32_t exe_type;
+ uint32_t exe_type; // ExecutableType.
};
// Sanity check.
static_assert(sizeof(PatchElementHeader) == 20,
- "PatchElementHeader is 28 bytes");
+ "PatchElementHeader must be 20 bytes");
#pragma pack(pop)