summaryrefslogtreecommitdiffstats
path: root/tests/qtest/cdrom-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtest/cdrom-test.c')
-rw-r--r--tests/qtest/cdrom-test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index 5af944a5fb..c1fcac5c45 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -109,9 +109,11 @@ static void test_cdrom_param(gconstpointer data)
static void add_cdrom_param_tests(const char **machines)
{
while (*machines) {
- char *testname = g_strdup_printf("cdrom/param/%s", *machines);
- qtest_add_data_func(testname, *machines, test_cdrom_param);
- g_free(testname);
+ if (qtest_has_machine(*machines)) {
+ char *testname = g_strdup_printf("cdrom/param/%s", *machines);
+ qtest_add_data_func(testname, *machines, test_cdrom_param);
+ g_free(testname);
+ }
machines++;
}
}