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

Unified Diff: tests/tpm_lite/redefine_unowned.c

Issue 6349091: Improve error messages from tests (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: 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
Index: tests/tpm_lite/redefine_unowned.c
diff --git a/tests/tpm_lite/redefine_unowned.c b/tests/tpm_lite/redefine_unowned.c
index eb5dfe5d45b3acd272c13eff9787efc1d9fbfc73..f7d70d1648a22855249431cdd8ff8f3b56823c23 100644
--- a/tests/tpm_lite/redefine_unowned.c
+++ b/tests/tpm_lite/redefine_unowned.c
@@ -16,7 +16,6 @@
int main(int argc, char** argv) {
uint32_t perm;
- uint32_t result;
uint32_t x;
TlclLibInit();
@@ -43,8 +42,8 @@ int main(int argc, char** argv) {
TlclSetGlobalLock();
// Verifies that index0 cannot be redefined.
- result = TlclDefineSpace(INDEX0, perm, sizeof(uint32_t));
- assert(result == TPM_E_AREA_LOCKED);
+ TPM_EXPECT(TlclDefineSpace(INDEX0, perm, sizeof(uint32_t)),
+ TPM_E_AREA_LOCKED);
// Checks that index1 can.
TPM_CHECK(TlclDefineSpace(INDEX1, perm, 2 * sizeof(uint32_t)));
@@ -54,10 +53,10 @@ int main(int argc, char** argv) {
TlclLockPhysicalPresence();
// Verifies that neither index0 nor index1 can be redefined.
- result = TlclDefineSpace(INDEX0, perm, sizeof(uint32_t));
- assert(result == TPM_E_BAD_PRESENCE);
- result = TlclDefineSpace(INDEX1, perm, sizeof(uint32_t));
- assert(result == TPM_E_BAD_PRESENCE);
+ TPM_EXPECT(TlclDefineSpace(INDEX0, perm, sizeof(uint32_t)),
+ TPM_E_BAD_PRESENCE);
+ TPM_EXPECT(TlclDefineSpace(INDEX1, perm, sizeof(uint32_t)),
+ TPM_E_BAD_PRESENCE);
printf("TEST SUCCEEDED\n");
exit(0);

Powered by Google App Engine
This is Rietveld 408576698