From 1edf8bc46542ad302085b9e957c8c3c31c7db9da Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sat, 4 Jan 2020 16:03:35 +0100 Subject: QObject: Replace more 0 and NULL with nullptr ... in docs, comments, and warnings. Also adopt some occurrences around there and in the snippets. Change-Id: Icc0aa0868cadd8ec2270dda794bf83cd7ab84160 Reviewed-by: Christian Ehrlicher --- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index a805bfb747..21615d6ec4 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -6719,16 +6719,16 @@ void tst_QObject::connectWarnings() ReceiverObject r1; r1.reset(); - QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid null parameter"); + QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid nullptr parameter"); connect(static_cast(nullptr), &SubSender::signal1, &r1, &ReceiverObject::slot1); - QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SubSender, Unknown): invalid null parameter"); + QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SubSender, Unknown): invalid nullptr parameter"); connect(&sub, &SubSender::signal1, static_cast(nullptr), &ReceiverObject::slot1); - QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid null parameter"); + QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid nullptr parameter"); connect(static_cast(nullptr), &SenderObject::signal1, &r1, &ReceiverObject::slot1); - QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, Unknown): invalid null parameter"); + QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, Unknown): invalid nullptr parameter"); connect(&obj, &SenderObject::signal1, static_cast(nullptr), &ReceiverObject::slot1); } -- cgit v1.2.3 From bcc8cf5e3b7c139c762d957b02ddfcf75707bde0 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 8 Jan 2020 11:30:35 +0100 Subject: Fix encoding inconsistency between tst_QNoDebug and QTestLog Fix tst_QNoDebug::streaming() to use toLocal8Bit(), to match QTestLog::ignoreMessage(), which uses fromLocal8Bit(). Change-Id: I65f7b995a582aeab7b7ba61781a229fecd1ed3c3 Reviewed-by: Thiago Macieira Reviewed-by: David Faure --- tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index b05c89a8bb..cf2079a407 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -65,7 +65,7 @@ void tst_QNoDebug::noDebugOutput() const void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); - const QByteArray debugString = dt.toString(u"yyyy-MM-dd HH:mm:ss.zzz t").toLatin1(); + const QByteArray debugString = dt.toString(u"yyyy-MM-dd HH:mm:ss.zzz t").toLocal8Bit(); const QByteArray message = "QDateTime(" + debugString + " Qt::LocalTime)"; QTest::ignoreMessage(QtWarningMsg, message.constData()); qWarning() << dt; -- cgit v1.2.3 From 70d484b5df6211546e17f336782f83a3f856965d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 8 Jan 2020 17:05:15 +0100 Subject: Fix encoding expected by tst_qmessagehandler::qMessagePattern() The actual logging code, qt_message_print(), uses toLocal8Bit(), so testing by comaring with toUtf8() isn't robust. Change-Id: I7d6614e4af8c679674dbbf4ff47a88b2b75fc2dc Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 17d0f86728..3af637d13a 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2014 Olivier Goffart ** Contact: https://www.qt.io/licensing/ ** @@ -767,18 +767,18 @@ void tst_qmessagehandler::qMessagePattern_data() QTest::qWait(10000); QTest::newRow("time") << "/%{time yyyy - MM - d}/%{message}" << true << (QList() - << ('/' + QDateTime::currentDateTime().toString("yyyy - MM - d").toUtf8() + "/qDebug")); + << ('/' + QDateTime::currentDateTime().toString("yyyy - MM - d").toLocal8Bit() + "/qDebug")); QTest::newRow("time-time") << "/%{time yyyy - MM - d}/%{time dd-MM-yy}/%{message}" << true << (QList() - << ('/' + QDateTime::currentDateTime().toString("yyyy - MM - d").toUtf8() - + '/' + QDateTime::currentDateTime().toString("dd-MM-yy").toUtf8() + << ('/' + QDateTime::currentDateTime().toString("yyyy - MM - d").toLocal8Bit() + + '/' + QDateTime::currentDateTime().toString("dd-MM-yy").toLocal8Bit() + "/qDebug")); QTest::newRow("skipped-time-shown-time") << "/%{if-warning}%{time yyyy - MM - d}%{endif}%{if-debug}%{time dd-MM-yy}%{endif}/%{message}" << true << (QList() - << ('/' + QDateTime::currentDateTime().toString("dd-MM-yy").toUtf8() + "/qDebug")); + << ('/' + QDateTime::currentDateTime().toString("dd-MM-yy").toLocal8Bit() + "/qDebug")); // %{time} should have a padding of 6 so if it takes less than 10 seconds to show // the first message, there should be 5 spaces -- cgit v1.2.3