qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-riscv@nongnu.org
Subject: Re: [PATCH 3/8] tests/qtest/boot-order-test: Make the machine name mandatory in this test
Date: Fri, 6 Sep 2024 09:59:35 +0200	[thread overview]
Message-ID: <639f1017-4e74-4fdc-89a6-6aeca6c0737c@linaro.org> (raw)
In-Reply-To: <20240905191434.694440-4-thuth@redhat.com>

Hi Thomas,

On 5/9/24 21:14, Thomas Huth wrote:
> Let's make sure that we always pass a machine name to the test_boot_orders()
> function, so we can check whether the machine is available in the binary
> and skip the test in case it is not included in the build.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qtest/boot-order-test.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/boot-order-test.c b/tests/qtest/boot-order-test.c
> index 8f2b6ef05a..c67b8cfe16 100644
> --- a/tests/qtest/boot-order-test.c
> +++ b/tests/qtest/boot-order-test.c
> @@ -31,7 +31,7 @@ static void test_a_boot_order(const char *machine,
>       uint64_t actual;
>       QTestState *qts;
>   
> -    if (machine && !qtest_has_machine(machine)) {
> +    if (!qtest_has_machine(machine)) {

Should we defer the NULL check to qtest_has_machine_with_env()?
It uses g_str_equal() which is described as:

   Note that this function is primarily meant as a hash table
   comparison function. For a general-purpose, NULL-safe string
   comparison function, see g_strcmp0().

Better switch to g_strcmp0() in qtest_has_machine_with_env()?

>           g_test_skip("Machine is not available");
>           return;
>       }
> @@ -107,7 +107,7 @@ static const boot_order_test test_cases_pc[] = {
>   
>   static void test_pc_boot_order(void)
>   {
> -    test_boot_orders(NULL, read_boot_order_pc, test_cases_pc);
> +    test_boot_orders("pc", read_boot_order_pc, test_cases_pc);
>   }
>   
>   static uint64_t read_boot_order_pmac(QTestState *qts)



  reply	other threads:[~2024-09-06  8:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 19:14 [PATCH 0/8] Allow check-qtest with "--without-default-devices" Thomas Huth
2024-09-05 19:14 ` [PATCH 1/8] tests/qtest/migration: Add a check for the availability of the "pc" machine Thomas Huth
2024-09-05 19:14 ` [PATCH 2/8] tests/qtest/cdrom-test: Improve the machine detection in the cdrom test Thomas Huth
2024-09-05 19:14 ` [PATCH 3/8] tests/qtest/boot-order-test: Make the machine name mandatory in this test Thomas Huth
2024-09-06  7:59   ` Philippe Mathieu-Daudé [this message]
2024-09-06  8:04     ` Thomas Huth
2024-09-06  8:07       ` Philippe Mathieu-Daudé
2024-09-05 19:14 ` [PATCH 4/8] tests/qtest/hd-geo-test: Check for availability of "pc" machine before using it Thomas Huth
2024-09-06  7:50   ` Philippe Mathieu-Daudé
2024-09-06  7:52     ` Thomas Huth
2024-09-05 19:14 ` [PATCH 5/8] tests/qtest/meson.build: Add more CONFIG switches checks for the x86 tests Thomas Huth
2024-09-05 19:14 ` [PATCH 6/8] tests/qtest: Disable numa-test if the default machine is not available Thomas Huth
2024-09-05 19:14 ` [PATCH 7/8] Revert "target/riscv: Restrict semihosting to TCG" Thomas Huth
2024-09-05 19:53   ` Peter Maydell
2024-09-06  8:15     ` Thomas Huth
2024-09-06  8:16     ` Philippe Mathieu-Daudé
2024-09-05 19:14 ` [PATCH 8/8] .gitlab-ci.d/buildtest: Build most targets in the build-without-defaults job Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=639f1017-4e74-4fdc-89a6-6aeca6c0737c@linaro.org \
    --to=philmd@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).