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

Unified Diff: tests/vboot_common_tests.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 | « tests/cgptlib_test.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/vboot_common_tests.c
diff --git a/tests/vboot_common_tests.c b/tests/vboot_common_tests.c
index e467471e761c930942340f1c409fa8e231236cdd..e707daf13160050fddaaf28833402d2412c31045 100644
--- a/tests/vboot_common_tests.c
+++ b/tests/vboot_common_tests.c
@@ -11,9 +11,23 @@
#include "test_common.h"
#include "vboot_common.h"
+/* Test struct packing */
+static void StructPackingTest(void) {
+ TEST_EQ(EXPECTED_VBPUBLICKEY_SIZE, sizeof(VbPublicKey),
+ "sizeof(VbPublicKey)");
+ TEST_EQ(EXPECTED_VBSIGNATURE_SIZE, sizeof(VbSignature),
+ "sizeof(VbSignature)");
+ TEST_EQ(EXPECTED_VBKEYBLOCKHEADER_SIZE, sizeof(VbKeyBlockHeader),
+ "sizeof(VbKeyBlockHeader)");
+ TEST_EQ(EXPECTED_VBFIRMWAREPREAMBLEHEADER_SIZE,
+ sizeof(VbFirmwarePreambleHeader), "sizeof(VbFirmwarePreambleHeader)");
+ TEST_EQ(EXPECTED_VBKERNELPREAMBLEHEADER_SIZE,
+ sizeof(VbKernelPreambleHeader), "sizeof(VbKernelPreambleHeader)");
+}
+
/* Helper functions not dependent on specific key sizes */
-void VerifyHelperFunctions(void) {
+static void VerifyHelperFunctions(void) {
{
uint8_t p[1];
@@ -91,7 +105,7 @@ void VerifyHelperFunctions(void) {
int main(int argc, char* argv[]) {
int error_code = 0;
- /* Test helper functions */
+ StructPackingTest();
VerifyHelperFunctions();
if (!gTestSuccess)
« no previous file with comments | « tests/cgptlib_test.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698