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

Unified Diff: tests/tpm_lite/timing.c

Issue 6462013: Run TPM timing test to completion instead of stopping at the first error. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/tpm_lite/timing.c
diff --git a/tests/tpm_lite/timing.c b/tests/tpm_lite/timing.c
index 9300d0ccaace68b1dc9a6f1d6d7a5a2a1e9600d7..d18ce05b0df74a363e702405da083c1272bd70e7 100644
--- a/tests/tpm_lite/timing.c
+++ b/tests/tpm_lite/timing.c
@@ -29,7 +29,6 @@
__result = op; \
if (__result != TPM_SUCCESS) { \
printf(#op ": error 0x%x\n", __result); \
Randall Spangler 2011/02/08 23:03:44 Suggest incrementing an errors count here. errors
- exit(1); \
} \
gettimeofday(&after, NULL); \
time = (int) ((after.tv_sec - before.tv_sec) * 1000 + \
@@ -37,15 +36,17 @@
printf(#op ": %d ms\n", time); \
if (time > time_limit) { \
printf(#op " exceeded " #time_limit " ms\n"); \
- exit(1); \
+ time_limit_exceeded = 1; \
} \
} while (0)
int main(int argc, char** argv) {
uint32_t x;
uint8_t in[20], out[20];
+ int time_limit_exceeded = 0;
Randall Spangler 2011/02/08 23:03:44 int errors = 0;
TlclLibInit();
+ TTPM_CHECK(0, 50);
TTPM_CHECK(TlclStartupIfNeeded(), 50);
TTPM_CHECK(TlclContinueSelfTest(), 100);
TTPM_CHECK(TlclSelfTestFull(), 1000);
@@ -55,6 +56,11 @@ int main(int argc, char** argv) {
TTPM_CHECK(TlclExtend(0, in, out), 200);
TTPM_CHECK(TlclSetGlobalLock(), 50);
TTPM_CHECK(TlclLockPhysicalPresence(), 100);
- printf("TEST SUCCEEDED\n");
- return 0;
+ if (time_limit_exceeded) {
Randall Spangler 2011/02/08 23:03:44 if (time_limit_exceeded || errors > 0) This way y
+ printf("TEST FAILED\n");
+ exit(1);
+ } else {
+ printf("TEST SUCCEEDED\n");
+ return 0;
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698