From 9cb21d2879413176e27e8fc4a702f6c91c11b5cd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 18 Jul 2022 00:09:07 +0200 Subject: [PATCH] tracing/Qbs: Turn crash in tst_flamegraphview into a failure Don't crash if qml scene instantiation fails (e.g. when built with Qt 6 and Qbs). Just fail the test. Change-Id: I444a6a68382c5acc9ca9faf9ce7c489a87fa5c98 Reviewed-by: Reviewed-by: Christian Stenger --- tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp index 800b8543e82..5b8d9069e8e 100644 --- a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp +++ b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp @@ -99,7 +99,8 @@ void tst_FlameGraphView::initTestCase() void tst_FlameGraphView::testZoom() { auto selectedTypeId = [&]() { - return widget.rootObject()->property("selectedTypeId").toInt(); + const QQuickItem *item = widget.rootObject(); + return item ? item->property("selectedTypeId").toInt() : -1; }; QWindow *window = widget.windowHandle();