OLD | NEW |
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 | 6 |
7 #ifndef VBOOT_REFERENCE_TEST_COMMON_H_ | 7 #ifndef VBOOT_REFERENCE_TEST_COMMON_H_ |
8 #define VBOOT_REFERENCE_TEST_COMMON_H_ | 8 #define VBOOT_REFERENCE_TEST_COMMON_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
12 #include "firmware_image.h" | 12 #include "firmware_image.h" |
13 #include "kernel_image.h" | 13 #include "kernel_image.h" |
14 | 14 |
15 extern int gTestSuccess; | 15 extern int gTestSuccess; |
| 16 |
16 /* Return 1 if result is equal to expected_result, else return 0. | 17 /* Return 1 if result is equal to expected_result, else return 0. |
17 * Also update the global gTestSuccess flag if test fails. */ | 18 * Also update the global gTestSuccess flag if test fails. */ |
18 int TEST_EQ(int result, int expected_result, char* testname); | 19 int TEST_EQ(int result, int expected_result, char* testname); |
| 20 /* Return 0 if result is equal to not_expected_result, else return 1. |
| 21 * Also update the global gTestSuccess flag if test fails. */ |
| 22 int TEST_NEQ(int result, int not_expected_result, char* testname); |
19 | 23 |
20 /* Test firmware image generation functions. */ | 24 /* Test firmware image generation functions. */ |
21 FirmwareImage* GenerateTestFirmwareImage(int algorithm, | 25 FirmwareImage* GenerateTestFirmwareImage(int algorithm, |
22 const uint8_t* firmware_sign_key, | 26 const uint8_t* firmware_sign_key, |
23 int firmware_key_version, | 27 int firmware_key_version, |
24 int firmware_version, | 28 int firmware_version, |
25 uint64_t firmware_len, | 29 uint64_t firmware_len, |
26 const char* root_key_file, | 30 const char* root_key_file, |
27 const char* firmware_key_file, | 31 const char* firmware_key_file, |
28 uint8_t firmware_data_fill_char); | 32 uint8_t firmware_data_fill_char); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 uint8_t* GenerateRollbackTestVerificationBlob(int firmware_key_version, | 64 uint8_t* GenerateRollbackTestVerificationBlob(int firmware_key_version, |
61 int firmware_version); | 65 int firmware_version); |
62 | 66 |
63 /* Generates a test kernel iamge for rollback tests with a given | 67 /* Generates a test kernel iamge for rollback tests with a given |
64 * [kernel_key_version} and [kernel_version]. If [is_corrupt] is 1, | 68 * [kernel_key_version} and [kernel_version]. If [is_corrupt] is 1, |
65 * then the image has invalid signatures and will fail verification. */ | 69 * then the image has invalid signatures and will fail verification. */ |
66 uint8_t* GenerateRollbackTestKernelBlob(int kernel_key_version, | 70 uint8_t* GenerateRollbackTestKernelBlob(int kernel_key_version, |
67 int kernel_version, | 71 int kernel_version, |
68 int is_corrupt); | 72 int is_corrupt); |
69 #endif /* VBOOT_REFERENCE_TEST_COMMON_H_ */ | 73 #endif /* VBOOT_REFERENCE_TEST_COMMON_H_ */ |
OLD | NEW |