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

Side by Side Diff: tests/sha_tests.c

Issue 2809037: Make vboot_reference build in MSVC command line environment. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Integrated trunk changes. 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 unified diff | Download patch
« no previous file with comments | « tests/rollback_index_mock.c ('k') | tests/test_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* FIPS 180-2 Tests for message digest functions. */ 6 /* FIPS 180-2 Tests for message digest functions. */
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 fprintf(stderr, "Test vector %d PASSED for SHA-512\n", i+1); 71 fprintf(stderr, "Test vector %d PASSED for SHA-512\n", i+1);
72 } 72 }
73 else { 73 else {
74 fprintf(stderr, "Test vector %d FAILED for SHA-512\n", i+1); 74 fprintf(stderr, "Test vector %d FAILED for SHA-512\n", i+1);
75 success = 0; 75 success = 0;
76 } 76 }
77 } 77 }
78 return success; 78 return success;
79 } 79 }
80 80
81 /* disable MSVC warnings on unused arguments */
82 __pragma(warning (disable: 4100))
83
81 int main(int argc, char* argv[]) { 84 int main(int argc, char* argv[]) {
82 int success = 1; 85 int success = 1;
83 /* Initialize long_msg with 'a' x 1,000,000 */ 86 /* Initialize long_msg with 'a' x 1,000,000 */
84 long_msg = (char *) malloc(1000001); 87 long_msg = (char *) malloc(1000001);
85 memset(long_msg, 'a', 1000000); 88 memset(long_msg, 'a', 1000000);
86 long_msg[1000000]=0; 89 long_msg[1000000]=0;
87 90
88 if (!SHA1_tests()) 91 if (!SHA1_tests())
89 success = 0; 92 success = 0;
90 if (!SHA256_tests()) 93 if (!SHA256_tests())
91 success = 0; 94 success = 0;
92 if (!SHA512_tests()) 95 if (!SHA512_tests())
93 success = 0; 96 success = 0;
94 97
95 free(long_msg); 98 free(long_msg);
96 99
97 return !success; 100 return !success;
98 } 101 }
OLDNEW
« no previous file with comments | « tests/rollback_index_mock.c ('k') | tests/test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698