[Qemu-devel] [PATCH] tests: tpm: Use g_test_message rather than fprintf

Stefan Berger posted 1 patch 6 years, 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181106151346.2728687-1-stefanb@linux.vnet.ibm.com
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
tests/tpm-tests.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] tests: tpm: Use g_test_message rather than fprintf
Posted by Stefan Berger 6 years, 12 months ago
Display a message during the test using g_test_message rather
than fprintf.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 tests/tpm-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c
index 93a5beba01..5f217a2d92 100644
--- a/tests/tpm-tests.c
+++ b/tests/tpm-tests.c
@@ -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;
     }
 
-- 
2.17.1


Re: [Qemu-devel] [PATCH] tests: tpm: Use g_test_message rather than fprintf
Posted by Thomas Huth 6 years, 12 months ago
On 2018-11-06 16:13, Stefan Berger wrote:
> Display a message during the test using g_test_message rather
> than fprintf.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> ---
>  tests/tpm-tests.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c
> index 93a5beba01..5f217a2d92 100644
> --- a/tests/tpm-tests.c
> +++ b/tests/tpm-tests.c
> @@ -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:

Reviewed-by: Thomas Huth <thuth@redhat.com>