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()?