From 0ffb7d6f58f546d92e9c7adf7fb03eef4ecdabab Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Tue, 10 Feb 2026 23:08:24 +0100 Subject: [PATCH] Fix test_type_selector for Qt5 and stale expectation - Register uint64_t metatype for QSignalSpy in Qt5 (not needed in Qt6) - Update command row expectation: "NoName" matches controller output --- tests/test_type_selector.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_type_selector.cpp b/tests/test_type_selector.cpp index d0a3338..ffe32f0 100644 --- a/tests/test_type_selector.cpp +++ b/tests/test_type_selector.cpp @@ -7,6 +7,10 @@ #include "typeselectorpopup.h" #include "core.h" +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +Q_DECLARE_METATYPE(uint64_t) +#endif + using namespace rcx; static void buildTwoRootTree(NodeTree& tree) { @@ -44,6 +48,11 @@ class TestTypeSelector : public QObject { Q_OBJECT private slots: + void initTestCase() { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + qRegisterMetaType("uint64_t"); +#endif + } // ── Chevron span detection ── @@ -203,9 +212,9 @@ private slots: QCOMPARE(doc->tree.nodes[idx].parentId, (uint64_t)0); QCOMPARE(ctrl->viewRootId(), newId); - // Command row shows "" - QVERIFY2(sci->text(0).contains(""), - qPrintable("Expected '' in command row, got: " + sci->text(0))); + // Command row shows "NoName" for empty-named struct + QVERIFY2(sci->text(0).contains("NoName"), + qPrintable("Expected 'NoName' in command row, got: " + sci->text(0))); // -- Undo removes the new struct -- doc->undoStack.undo();