| Index: tests/tpm_lite/enable.c
|
| diff --git a/tests/tpm_lite/enable.c b/tests/tpm_lite/enable.c
|
| index a9172ba9dd6ca49f1b43e237ecf3a2302c1f32f5..73e9c656d11762dbc04c9fd93bb613fef58c5f5f 100644
|
| --- a/tests/tpm_lite/enable.c
|
| +++ b/tests/tpm_lite/enable.c
|
| @@ -6,17 +6,31 @@
|
| /* Testing: ownership testing code, ForceClear, and nvram write limit.
|
| */
|
|
|
| +#include <stdio.h>
|
| +
|
| #include "tlcl.h"
|
|
|
| +#define CHECK(command) do { \
|
| + uint32_t r = (command); \
|
| + if (r != 0) { \
|
| + printf(#command "returned 0x%x\n", r); \
|
| + } \
|
| +} while(0)
|
| +
|
| int main(int argc, char** argv) {
|
| + uint8_t disable, deactivated;
|
|
|
| TlclLibInit();
|
| TlclStartup();
|
| - TlclSelfTestFull();
|
| + CHECK(TlclSelfTestFull());
|
|
|
| - TlclAssertPhysicalPresence();
|
| - TlclSetEnable();
|
| - (void) TlclSetDeactivated(0); // activates the TPM at the next boot
|
| + CHECK(TlclAssertPhysicalPresence());
|
| + CHECK(TlclGetFlags(&disable, &deactivated, NULL));
|
| + printf("disable is %d, deactivated is %d\n", disable, deactivated);
|
| + CHECK(TlclSetEnable());
|
| + CHECK(TlclSetDeactivated(0));
|
| + CHECK(TlclGetFlags(&disable, &deactivated, NULL));
|
| + printf("disable is %d, deactivated is %d\n", disable, deactivated);
|
|
|
| return 0;
|
| }
|
|
|