From 46b892c16c4c9fd10a04bc6d695d1e47bc52a84d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 20 Jan 2021 14:04:47 +0100 Subject: [PATCH] tst_qvulkan: Skip assumption about supportedApiVersion ...when the platform does not support Vulkan. The version is left at the default 0 then, so checking for >= 1.0 is wrong. This allows the test to pass with the offscreen platform plugin. Change-Id: I5afba8f1e703e4fa0ff41da91d18f5fabfb54868 Reviewed-by: Andreas Buhr Reviewed-by: Andy Nichols --- tests/auto/gui/qvulkan/tst_qvulkan.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp index 5b425158f9..79794f7bdf 100644 --- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp +++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp @@ -100,13 +100,14 @@ void tst_QVulkan::vulkanCheckSupported() qDebug() << ve; QVERIFY(!inst.isValid()); + const QVersionNumber supportedApiVersion = inst.supportedApiVersion(); + qDebug() << supportedApiVersion.majorVersion() << supportedApiVersion.minorVersion(); + if (inst.create()) { // skip the rest when Vulkan is not supported at all QVERIFY(!ve.isEmpty()); QVERIFY(ve == inst.supportedExtensions()); + QVERIFY(supportedApiVersion.majorVersion() >= 1); } - - qDebug() << inst.supportedApiVersion(); - QVERIFY(inst.supportedApiVersion().majorVersion() >= 1); } void tst_QVulkan::vulkan11()