summaryrefslogtreecommitdiff
path: root/tests/vboot_common2_tests.c
diff options
context:
space:
mode:
authorvbendeb <vbendeb@chromium.org>2010-06-24 16:19:53 -0700
committervbendeb <vbendeb@chromium.org>2010-06-24 16:19:53 -0700
commit3ecaf776d82d29573be083b2e5c6ddc5b9f49c70 (patch)
tree3887c0749d73e45562a250c275f56eb4f5356613 /tests/vboot_common2_tests.c
parentd6aad3a0888ad57383036dacdfc4c01f0c3b56e3 (diff)
downloadvboot-3ecaf776d82d29573be083b2e5c6ddc5b9f49c70.tar.gz
Make vboot_reference build in MSVC command line environment.
This is a mostly NOOP change which modifies the source code to compile cleanly in the MSVC command line build environment. A new makefile is introduced (msc/nmakefile) along with a README.txt in the same directory explaining how to build the code in the DOS window. As of this submission the build is running in a 32 bit environment, the intention is to use the same makefile for 64 bit builds in the future. Enabling high compilation warnings level allowed to identify a couple of bugs in the code which are being fixed. Not all sources are being compiled in the MSVC environment, only those in firmware/ and most of those in test/ subdirectories. The benchmark calculations require porting of the timer facilities and are being postponed. TEST Built in DOS and linux environments. Ran unit tests in linux environment. Review URL: http://codereview.chromium.org/2809037
Diffstat (limited to 'tests/vboot_common2_tests.c')
-rw-r--r--tests/vboot_common2_tests.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/vboot_common2_tests.c b/tests/vboot_common2_tests.c
index b4c9096a..9fee525a 100644
--- a/tests/vboot_common2_tests.c
+++ b/tests/vboot_common2_tests.c
@@ -34,7 +34,8 @@ static void VerifyPublicKeyToRSA(const VbPublicKey* orig_key) {
rsa = PublicKeyToRSA(orig_key);
TEST_NEQ((size_t)rsa, 0, "PublicKeyToRSA() ok");
if (rsa) {
- TEST_EQ(rsa->algorithm, key->algorithm, "PublicKeyToRSA() algorithm");
+ TEST_EQ((int)rsa->algorithm, (int)key->algorithm,
+ "PublicKeyToRSA() algorithm");
RSAPublicKeyFree(rsa);
}
}
@@ -77,7 +78,7 @@ static void VerifyDigestTest(const VbPublicKey* public_key,
sig = CalculateSignature(test_data, sizeof(test_data), private_key);
rsa = PublicKeyToRSA(public_key);
- digest = DigestBuf(test_data, sizeof(test_data), public_key->algorithm);
+ digest = DigestBuf(test_data, sizeof(test_data), (int)public_key->algorithm);
TEST_NEQ(sig && rsa && digest, 0, "VerifyData() prerequisites");
if (!sig || !rsa || !digest)
return;
@@ -109,7 +110,7 @@ static void VerifyKernelPreambleTest(const VbPublicKey* public_key,
VbKernelPreambleHeader *hdr;
VbKernelPreambleHeader *h;
RSAPublicKey* rsa;
- uint64_t hsize;
+ unsigned hsize;
/* Create a dummy signature */
VbSignature *body_sig = SignatureAlloc(56, 78);
@@ -120,7 +121,7 @@ static void VerifyKernelPreambleTest(const VbPublicKey* public_key,
TEST_NEQ(hdr && rsa, 0, "VerifyKernelPreamble2() prerequisites");
if (!hdr)
return;
- hsize = hdr->preamble_size;
+ hsize = (unsigned) hdr->preamble_size;
h = (VbKernelPreambleHeader*)Malloc(hsize + 16384);
TEST_EQ(VerifyKernelPreamble2(hdr, hsize, rsa), 0,