Skip to contentSkip to conversation

tests: tpm: Use g_test_message rather than fprintf

PATCH In review Stefan Berger 2 participants 2 messages Nov 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: tpm: Use g_test_message rather than fprintf

Display a message during the test using g_test_message rather than fprintf.

---
 tests/tpm-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tpm-tests.c +1 -1
index 93a5beba01..5f217a2d92 100644
@@ -22,7 +22,7 @@ static bool
 tpm_test_swtpm_skip(void)
 {
     if (!tpm_util_swtpm_has_tpm2()) {
-        fprintf(stderr, "swtpm not in PATH or missing --tpm2 support; ");
+        g_test_message("swtpm not in PATH or missing --tpm2 support; ");
         return true;
     }
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Stefan Berger

Display a message during the test using g_test_message rather than fprintf.

---
 tests/tpm-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tpm-tests.c +0 -0
index 93a5beba01..5f217a2d92 100644

tests/tpm-tests.c static bool · line 27

Quoted 7 lines
tests/tpm-tests.c +1 -1
@@ -22,7 +22,7 @@ static bool
 tpm_test_swtpm_skip(void)
 {
     if (!tpm_util_swtpm_has_tpm2()) {
-        fprintf(stderr, "swtpm not in PATH or missing --tpm2 support; ");
+        g_test_message("swtpm not in PATH or missing --tpm2 support; ");
         return true;
     }

I think I'd rather remove the semicolon at the end now. Anyway: