[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] qtests: avoid printing comments before g_test_init()
From: |
Juan Quintela |
Subject: |
Re: [PATCH] qtests: avoid printing comments before g_test_init() |
Date: |
Thu, 23 Mar 2023 19:31:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Daniel P. Berrangé <berrange@redhat.com> wrote:
> The TAP protocol version line must be the first thing printed on
> stdout. The migration test failed that requirement in certain
> scenarios:
>
> # Skipping test: Userfault not available (builtdtime)
> TAP version 13
> # random seed: R02Sc120c807f11053eb90bfea845ba1e368
> 1..32
> # Start of x86_64 tests
> # Start of migration tests
> ....
>
> The TAP version is printed by g_test_init(), so we need to make
> sure that any methods which print are run after that.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
Reviewed-by: Juan Quintela <quintela@redhat.com>
> - const bool has_kvm = qtest_has_accel("kvm");
> - const bool has_uffd = ufd_version_check();
> - const char *arch = qtest_get_arch();
> + bool has_kvm;
> + bool has_uffd;
> + const char *arch;
Why don't you move also the declarations of the variables?
I think that one of the biggest troubles of C is variables that are not
initialized.
All compilers that we support are C99 or later, so we can do that (and
we already do in lot of places.)
And yeap, I know that CodingStyle says otherwise, but I think that what
is wrong is CodingStyle.
https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03836.html
Later, Juan.