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

Unified Diff: tests/tpm_lite/globallock.c

Issue 6349091: Improve error messages from tests (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: small improvements Created 9 years, 11 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 | tests/tpm_lite/redefine_unowned.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/tpm_lite/globallock.c
diff --git a/tests/tpm_lite/globallock.c b/tests/tpm_lite/globallock.c
index 98a49df75d3285d61d7109628c28dfbce5e5cf5c..24b6861faffa84d107e08c438888035aca918f5a 100644
--- a/tests/tpm_lite/globallock.c
+++ b/tests/tpm_lite/globallock.c
@@ -16,7 +16,6 @@
int main(int argc, char** argv) {
uint32_t zero = 0;
- uint32_t result;
uint32_t x;
TlclLibInit();
@@ -31,8 +30,7 @@ int main(int argc, char** argv) {
// Verifies that write to index0 fails.
x = 1;
- result = TlclWrite(INDEX0, (uint8_t*) &x, sizeof(x));
- assert(result == TPM_E_AREA_LOCKED);
+ TPM_EXPECT(TlclWrite(INDEX0, (uint8_t*) &x, sizeof(x)), TPM_E_AREA_LOCKED);
TPM_CHECK(TlclRead(INDEX0, (uint8_t*) &x, sizeof(x)));
assert(x == 0);
@@ -47,8 +45,7 @@ int main(int argc, char** argv) {
// Verifies that write to index1 fails.
x = 3;
- result = TlclWrite(INDEX1, (uint8_t*) &x, sizeof(x));
- assert(result == TPM_E_BAD_PRESENCE);
+ TPM_EXPECT(TlclWrite(INDEX1, (uint8_t*) &x, sizeof(x)), TPM_E_BAD_PRESENCE);
TPM_CHECK(TlclRead(INDEX1, (uint8_t*) &x, sizeof(x)));
assert(x == 2);
printf("TEST SUCCEEDED\n");
« no previous file with comments | « no previous file | tests/tpm_lite/redefine_unowned.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698