summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-07-06 14:06:08 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-15 14:43:30 +0200
commit3ef8ec2ee187b949b3f6840ca03bcc0e814c00a9 (patch)
tree2d9794d1b2ec0ec1caa8f8da3bf6ddc32fb9d894 /tests/auto/corelib/io
parent8ad9e81694fda39fbecebb9f97491004e9ac8c41 (diff)
Constrain the data stream operators for containers
Check that we can successfully instantiate the data 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: Ib100a5242470d7fc8067058cc4d81af2fa9354b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 72412aa44d..0b54f53517 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -35,11 +35,13 @@
#include <QtConcurrentRun>
#include <QFutureSynchronizer>
-static_assert(QTypeTraits::has_ostream_v<QDebug, int>);
-static_assert(QTypeTraits::has_ostream_v<QDebug, QList<int>>);
+static_assert(QTypeTraits::has_ostream_operator_v<QDebug, int>);
+static_assert(QTypeTraits::has_ostream_operator_v<QDebug, QList<int>>);
+static_assert(QTypeTraits::has_ostream_operator_v<QDebug, QMap<int, QString>>);
struct NonStreamable {};
-static_assert(!QTypeTraits::has_ostream_v<QDebug, NonStreamable>);
-static_assert(!QTypeTraits::has_ostream_v<QDebug, QList<NonStreamable>>);
+static_assert(!QTypeTraits::has_ostream_operator_v<QDebug, NonStreamable>);
+static_assert(!QTypeTraits::has_ostream_operator_v<QDebug, QList<NonStreamable>>);
+static_assert(!QTypeTraits::has_ostream_operator_v<QDebug, QMap<int, NonStreamable>>);
class tst_QDebug: public QObject
{