aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2022-09-25 19:30:16 +0800
committerThomas Huth <thuth@redhat.com>2022-09-27 20:51:21 +0200
commit4b83dd0efdbbf0e9213aa8e789ab0700e191ae24 (patch)
tree543a4e372d24998fec8251184b5d8a43dfe619df
parentbe181f87eb75d21ad82819e92175a2d6716527e0 (diff)
downloadqemu-4b83dd0efdbbf0e9213aa8e789ab0700e191ae24.zip
qemu-4b83dd0efdbbf0e9213aa8e789ab0700e191ae24.tar.gz
qemu-4b83dd0efdbbf0e9213aa8e789ab0700e191ae24.tar.bz2
tests/qtest: bios-tables-test: Adapt the case for win32
Single quotes in the arguments (oem_id='CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable' requires one of 'data' or 'file' Change to use double quotes which works fine on all platforms. Also /dev/null does not work on win32, and nul should be used. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220925113032.1949844-39-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/qtest/bios-tables-test.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 46a46fe..2ebeb53 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1615,6 +1615,12 @@ static void test_acpi_virt_viot(void)
free_test_data(&data);
}
+#ifndef _WIN32
+# define DEV_NULL "/dev/null"
+#else
+# define DEV_NULL "nul"
+#endif
+
static void test_acpi_q35_slic(void)
{
test_data data = {
@@ -1622,9 +1628,9 @@ static void test_acpi_q35_slic(void)
.variant = ".slic",
};
- test_acpi_one("-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id='ME',"
- "oem_rev=00002210,asl_compiler_id='qemu',"
- "asl_compiler_rev=00000000,data=/dev/null",
+ test_acpi_one("-acpitable sig=SLIC,oem_id=\"CRASH \",oem_table_id=ME,"
+ "oem_rev=00002210,asl_compiler_id=qemu,"
+ "asl_compiler_rev=00000000,data=" DEV_NULL,
&data);
free_test_data(&data);
}