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

Side by Side Diff: src/platform/vboot_reference/tests/firmware_image_tests.c

Issue 1138006: Fix test return values (otherwise, autotest mistakenly thinks it failed). (Closed)
Patch Set: Created 10 years, 9 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 | « no previous file | src/platform/vboot_reference/tests/kernel_image_tests.c » ('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 * Tests for firmware image library. 5 * Tests for firmware image library.
6 */ 6 */
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 int main(int argc, char* argv[]) { 143 int main(int argc, char* argv[]) {
144 uint64_t len; 144 uint64_t len;
145 uint8_t* firmware_sign_key_buf = NULL; 145 uint8_t* firmware_sign_key_buf = NULL;
146 uint8_t* root_key_blob = NULL; 146 uint8_t* root_key_blob = NULL;
147 uint8_t* firmware_blob = NULL; 147 uint8_t* firmware_blob = NULL;
148 uint64_t firmware_blob_len = 0; 148 uint64_t firmware_blob_len = 0;
149 FirmwareImage* image = NULL; 149 FirmwareImage* image = NULL;
150 RSAPublicKey* root_key = NULL; 150 RSAPublicKey* root_key = NULL;
151 int error_code = 1; 151 int error_code = 0;
152 152
153 if(argc != 6) { 153 if(argc != 6) {
154 fprintf(stderr, "Usage: %s <algorithm> <root key> <processed root pubkey>" 154 fprintf(stderr, "Usage: %s <algorithm> <root key> <processed root pubkey>"
155 " <signing key> <processed signing key>\n", argv[0]); 155 " <signing key> <processed signing key>\n", argv[0]);
156 return -1; 156 return -1;
157 } 157 }
158 158
159 /* Read verification keys and create a test image. */ 159 /* Read verification keys and create a test image. */
160 root_key = RSAPublicKeyFromFile(argv[3]); 160 root_key = RSAPublicKeyFromFile(argv[3]);
161 root_key_blob = BufferFromFile(argv[3], &len); 161 root_key_blob = BufferFromFile(argv[3], &len);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 failure: 196 failure:
197 Free(firmware_blob); 197 Free(firmware_blob);
198 FirmwareImageFree(image); 198 FirmwareImageFree(image);
199 Free(firmware_sign_key_buf); 199 Free(firmware_sign_key_buf);
200 Free(root_key_blob); 200 Free(root_key_blob);
201 RSAPublicKeyFree(root_key); 201 RSAPublicKeyFree(root_key);
202 202
203 return error_code; 203 return error_code;
204 } 204 }
OLDNEW
« no previous file with comments | « no previous file | src/platform/vboot_reference/tests/kernel_image_tests.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698