1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From: Martin Hostettler <textshell@uchuujin.de>
Date: Tue, 4 Nov 2025 21:23:56 +0100
Subject: tests: document_undo.cpp: Don't include Tui/Utils_p.h
Use a local copy of size2int.
This should make "as-installed" tests work again.
Origin: upstream, https://github.com/tuiwidgets/tuiwidgets/commit/e10a13a2e6025f1ccadca107e413729aeb7444a3
---
src/tests/document/document_undo.cpp | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/tests/document/document_undo.cpp b/src/tests/document/document_undo.cpp
index b6f1aef..1eead29 100644
--- a/src/tests/document/document_undo.cpp
+++ b/src/tests/document/document_undo.cpp
@@ -8,8 +8,6 @@
#include <optional>
-#include <Tui/Utils_p.h>
-
#include <Tui/ZTerminal.h>
#include <Tui/ZTextMetrics.h>
@@ -18,6 +16,21 @@
#include "../Testhelper.h"
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ static int size2int(qsizetype input) {
+ if (input < std::numeric_limits<int>::min() || input > std::numeric_limits<int>::max()) {
+ qFatal("Out of range size does not fit into int");
+ abort();
+ }
+ return static_cast<int>(input);
+ }
+#else
+ static int size2int(int input) {
+ return input;
+ }
+#endif
+
+
static QVector<QString> docToVec(const Tui::ZDocument &doc) {
QVector<QString> ret;
|