mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
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
This commit is contained in:
@@ -7,6 +7,10 @@
|
|||||||
#include "typeselectorpopup.h"
|
#include "typeselectorpopup.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
Q_DECLARE_METATYPE(uint64_t)
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace rcx;
|
using namespace rcx;
|
||||||
|
|
||||||
static void buildTwoRootTree(NodeTree& tree) {
|
static void buildTwoRootTree(NodeTree& tree) {
|
||||||
@@ -44,6 +48,11 @@ class TestTypeSelector : public QObject {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase() {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
qRegisterMetaType<uint64_t>("uint64_t");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// ── Chevron span detection ──
|
// ── Chevron span detection ──
|
||||||
|
|
||||||
@@ -203,9 +212,9 @@ private slots:
|
|||||||
QCOMPARE(doc->tree.nodes[idx].parentId, (uint64_t)0);
|
QCOMPARE(doc->tree.nodes[idx].parentId, (uint64_t)0);
|
||||||
QCOMPARE(ctrl->viewRootId(), newId);
|
QCOMPARE(ctrl->viewRootId(), newId);
|
||||||
|
|
||||||
// Command row shows "<no name>"
|
// Command row shows "NoName" for empty-named struct
|
||||||
QVERIFY2(sci->text(0).contains("<no name>"),
|
QVERIFY2(sci->text(0).contains("NoName"),
|
||||||
qPrintable("Expected '<no name>' in command row, got: " + sci->text(0)));
|
qPrintable("Expected 'NoName' in command row, got: " + sci->text(0)));
|
||||||
|
|
||||||
// -- Undo removes the new struct --
|
// -- Undo removes the new struct --
|
||||||
doc->undoStack.undo();
|
doc->undoStack.undo();
|
||||||
|
|||||||
Reference in New Issue
Block a user