summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-07-06 13:08:40 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-15 14:43:23 +0200
commit8ad9e81694fda39fbecebb9f97491004e9ac8c41 (patch)
treeb5a5e9bc6bd95dea730cb466627e8a225bd1ab94 /tests/auto/corelib/io/qdebug/tst_qdebug.cpp
parent6c36fd8af7e873defa3843f49848a14980561647 (diff)
Constrain the debug stream operators for containers
Check that we can successfully instantiate the debug stream operator for a container before we actually try. This is required so we can automate registration of debug stream operators with QMetaType. Change-Id: I3943e7a443751d250c33b2ca1b9cf29207cfe6c4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qdebug/tst_qdebug.cpp')
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index ece9be642a..72412aa44d 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -35,6 +35,12 @@
#include <QtConcurrentRun>
#include <QFutureSynchronizer>
+static_assert(QTypeTraits::has_ostream_v<QDebug, int>);
+static_assert(QTypeTraits::has_ostream_v<QDebug, QList<int>>);
+struct NonStreamable {};
+static_assert(!QTypeTraits::has_ostream_v<QDebug, NonStreamable>);
+static_assert(!QTypeTraits::has_ostream_v<QDebug, QList<NonStreamable>>);
+
class tst_QDebug: public QObject
{
Q_OBJECT