summaryrefslogtreecommitdiff
path: root/tests/tpm_lite
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-10-04 17:46:29 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-23 16:28:14 +0000
commit3c477458fa7f1506e722ede38636eaced8810687 (patch)
tree6af8c80467619faa021405a72ab8c6e5eb12b55b /tests/tpm_lite
parentffa02e80c8cec862106607ffd0333258bb1ed62e (diff)
downloadvboot-3c477458fa7f1506e722ede38636eaced8810687.tar.gz
vboot: format hex numbers with %#x instead of 0x%x
Also standardize on using hex for printing ASCII key values across vboot_ui.c and vboot_ui_menu.c. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ib10288d95e29c248ebe807d99108aea75775b155 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1840191 Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'tests/tpm_lite')
-rw-r--r--tests/tpm_lite/lock.c2
-rw-r--r--tests/tpm_lite/startup.c6
-rw-r--r--tests/tpm_lite/tlcl_tests.h4
-rw-r--r--tests/tpm_lite/tpmtest_timing.c2
-rw-r--r--tests/tpm_lite/tpmtest_writelimit.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/tpm_lite/lock.c b/tests/tpm_lite/lock.c
index bfc10e2e..55d2dfe7 100644
--- a/tests/tpm_lite/lock.c
+++ b/tests/tpm_lite/lock.c
@@ -24,6 +24,6 @@ int main(int argc, char** argv) {
TlclWriteLock(INDEX0);
- printf("Locked 0x%x\n", INDEX0);
+ printf("Locked %#x\n", INDEX0);
exit(0);
}
diff --git a/tests/tpm_lite/startup.c b/tests/tpm_lite/startup.c
index 3d901f39..573373dc 100644
--- a/tests/tpm_lite/startup.c
+++ b/tests/tpm_lite/startup.c
@@ -15,17 +15,17 @@ int main(int argc, char** argv) {
TlclLibInit();
result = TlclStartup();
if (result != 0) {
- printf("tpm startup failed with 0x%x\n", result);
+ printf("tpm startup failed with %#x\n", result);
}
result = TlclGetFlags(NULL, NULL, NULL);
if (result != 0) {
- printf("tpm getflags failed with 0x%x\n", result);
+ printf("tpm getflags failed with %#x\n", result);
}
printf("executing SelfTestFull\n");
TlclSelfTestFull();
result = TlclGetFlags(NULL, NULL, NULL);
if (result != 0) {
- printf("tpm getflags failed with 0x%x\n", result);
+ printf("tpm getflags failed with %#x\n", result);
}
printf("TEST SUCCEEDED\n");
return 0;
diff --git a/tests/tpm_lite/tlcl_tests.h b/tests/tpm_lite/tlcl_tests.h
index 7b0d295c..db0999cd 100644
--- a/tests/tpm_lite/tlcl_tests.h
+++ b/tests/tpm_lite/tlcl_tests.h
@@ -19,8 +19,8 @@
uint32_t _result = (tpm_command); \
uint32_t _exp = (expected_result); \
if (_result != _exp) { \
- printf("TEST FAILED: line %d: " #tpm_command ": 0x%x" \
- " (expecting 0x%x)\n", __LINE__, _result, _exp); \
+ printf("TEST FAILED: line %d: " #tpm_command ": %#x" \
+ " (expecting %#x)\n", __LINE__, _result, _exp); \
return _result; \
} \
} while (0)
diff --git a/tests/tpm_lite/tpmtest_timing.c b/tests/tpm_lite/tpmtest_timing.c
index d86b4eee..1ec14a2e 100644
--- a/tests/tpm_lite/tpmtest_timing.c
+++ b/tests/tpm_lite/tpmtest_timing.c
@@ -28,7 +28,7 @@
gettimeofday(&before, NULL); \
__result = op; \
if (__result != TPM_SUCCESS) { \
- printf(#op ": error 0x%x\n", __result); \
+ printf(#op ": error %#x\n", __result); \
errors++; \
} \
gettimeofday(&after, NULL); \
diff --git a/tests/tpm_lite/tpmtest_writelimit.c b/tests/tpm_lite/tpmtest_writelimit.c
index 75bae9f1..05e4a178 100644
--- a/tests/tpm_lite/tpmtest_writelimit.c
+++ b/tests/tpm_lite/tpmtest_writelimit.c
@@ -43,7 +43,7 @@ int main(int argc, char** argv) {
"MAX_NV_WRITES_NOOWNER reached");
break;
default:
- VB2_DEBUG("unexpected error code %d (0x%x)\n",
+ VB2_DEBUG("unexpected error code %d (%#x)\n",
result, result);
exit(1);
}