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

Unified Diff: tests/cgptlib_test.c

Issue 2865014: Assorted integration fixes. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add struct size tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/vboot_kernel.c ('k') | tests/vboot_common_tests.c » ('j') | 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 a100579dda1a1b28cd91edb5a501e3723c92b859..29f91d871fa408cc668e396178a6dfb6a21446e7 100644
--- a/tests/cgptlib_test.c
+++ b/tests/cgptlib_test.c
@@ -171,6 +171,18 @@ static void BuildTestGptData(GptData* gpt) {
}
+/* Tests if the structures are the expected size; if this fails,
+ * struct packing is not working properly. */
+static int StructSizeTest() {
+
+ EXPECT(GUID_EXPECTED_SIZE == sizeof(Guid));
+ EXPECT(GPTHEADER_EXPECTED_SIZE == sizeof(GptHeader));
+ EXPECT(GPTENTRY_EXPECTED_SIZE == sizeof(GptEntry));
+
+ return TEST_OK;
+}
+
+
/* Tests if the default structure returned by BuildTestGptData() is good. */
static int TestBuildTestGptData() {
GptData* gpt;
@@ -1088,6 +1100,7 @@ int main(int argc, char *argv[]) {
test_func fp;
int retval;
} test_cases[] = {
+ { TEST_CASE(StructSizeTest), },
{ TEST_CASE(TestBuildTestGptData), },
{ TEST_CASE(ParameterTests), },
{ TEST_CASE(HeaderCrcTest), },
« no previous file with comments | « firmware/lib/vboot_kernel.c ('k') | tests/vboot_common_tests.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698