| OLD | NEW |
| (Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* Common definitions for test programs. |
| 7 */ |
| 8 |
| 9 #ifndef TLCL_TESTS_H |
| 10 #define TLCL_TESTS_H |
| 11 |
| 12 /* Standard testing indexes. */ |
| 13 #define INDEX0 0xcafe |
| 14 #define INDEX1 0xcaff |
| 15 |
| 16 #define DO_ON_FAILURE(tpm_command, action) do { \ |
| 17 uint32_t result; \ |
| 18 if ((result = (tpm_command)) != TPM_SUCCESS) { \ |
| 19 action; \ |
| 20 } \ |
| 21 } while (0) |
| 22 |
| 23 /* Prints error and returns on failure */ |
| 24 #define TPM_CHECK(tpm_command) \ |
| 25 DO_ON_FAILURE(tpm_command, \ |
| 26 printf("TEST FAILED: line %d: " #tpm_command ": 0x%x\n", \ |
| 27 __LINE__, result); return result) |
| 28 |
| 29 /* Executes TlclStartup(), but ignores POSTINIT error if the |
| 30 * TLCL_RESILIENT_STARTUP environment variable is set. |
| 31 */ |
| 32 uint32_t TlclStartupIfNeeded(void); |
| 33 |
| 34 #endif // TLCL_TESTS_H |
| OLD | NEW |