From d448f2ecb8bca7de1e69f9f6f10d0ffb8c3d1beb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 23 Sep 2019 16:46:07 +0200 Subject: Correct handling of -qfloat16(0) It is finite and normal; it classifies as a zero; and it should not be > qfloat16(0). Added tests to match. Change-Id: I7874fb54f622b4cdf28b0894050ad3e75cf5d77c Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp index 01a1789188..94f0afa5ed 100644 --- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp +++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp @@ -107,6 +107,7 @@ void tst_qfloat16::ltgt_data() QTest::addColumn("val2"); QTest::newRow("zero") << 0.0f << 0.0f; + QTest::newRow("-zero") << -0.0f << 0.0f; QTest::newRow("ten") << 10.0f << 10.0f; QTest::newRow("large") << 100000.0f << 100000.0f; QTest::newRow("small") << 0.0000001f << 0.0000001f; @@ -405,6 +406,7 @@ void tst_qfloat16::finite_data() QTest::addColumn("mode"); QTest::newRow("zero") << qfloat16(0) << FP_ZERO; + QTest::newRow("-zero") << -qfloat16(0) << FP_ZERO; QTest::newRow("one") << qfloat16(1) << FP_NORMAL; QTest::newRow("-one") << qfloat16(-1) << FP_NORMAL; QTest::newRow("ten") << qfloat16(10) << FP_NORMAL; @@ -459,6 +461,12 @@ void tst_qfloat16::limits() // See also: qNaN() and infinity() // A few useful values: const qfloat16 zero(0), one(1), ten(10); + // The specifics of minus zero: + // (IEEE 754 seems to want -zero < zero, but -0. == 0. and -0.f == 0.f in C++.) + QVERIFY(-zero <= zero); + QVERIFY(-zero == zero); + QVERIFY(!(-zero > zero)); + // digits in the mantissa, including the implicit 1 before the binary dot at its left: QVERIFY(qfloat16(1 << (Bounds::digits - 1)) + one > qfloat16(1 << (Bounds::digits - 1))); QVERIFY(qfloat16(1 << Bounds::digits) + one == qfloat16(1 << Bounds::digits)); @@ -523,7 +531,10 @@ void tst_qfloat16::limits() // See also: qNaN() and infinity() QVERIFY(Bounds::denorm_min() > zero); if (overOptimized) QEXPECT_FAIL("", "Over-optimized on ARM", Continue); - QCOMPARE(Bounds::denorm_min() / rose, zero); + QVERIFY(Bounds::denorm_min() / rose == zero); + if (overOptimized) + QEXPECT_FAIL("", "Over-optimized on ARM", Continue); + QVERIFY(-Bounds::denorm_min() / rose == -zero); } QTEST_APPLESS_MAIN(tst_qfloat16) -- cgit v1.2.3 From dcecaeb7b95f673bfae55c4cee1056bfc6e903d9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 1 Oct 2019 11:32:55 +0200 Subject: Prospective fix to stabilize tst_qwindow::isActive() on Windows 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is conceivable that during the try-compare loop of processing windowing system events we loose and regain the focus. That would explain the occasional test failure where instead of the expected 3 focus in events, we have received four. Task-number: QTBUG-77769 Change-Id: I2221440d09a74d4d18a72f7786232b4491cf45a8 Reviewed-by: Tor Arne Vestbø (cherry picked from commit 56f084781e2b8891929eca0070212fd7a32b32fc) Reviewed-by: Edward Welbourne --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 4f26950192..60f89fcb4e 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -893,7 +893,13 @@ void tst_QWindow::isActive() QTRY_COMPARE(QGuiApplication::focusWindow(), &window); QCoreApplication::processEvents(); QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1); - QTRY_COMPARE(window.received(QEvent::FocusIn), 3); + // We should be checking for exactly three, but since this is a try-compare _loop_, we might + // loose and regain focus multiple times in the event of a system popup. This has been observed + // to fail on Windows, see QTBUG-77769. + QTRY_VERIFY2(window.received(QEvent::FocusIn) >= 3, + qPrintable( + QStringLiteral("Expected more than three focus in events, received: %1") + .arg(window.received(QEvent::FocusIn)))); QVERIFY(window.isActive()); -- cgit v1.2.3 From 5ab8efd66a1a3c56f04a393ed1fe558ec8c1ba5c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 30 Sep 2019 14:23:55 +0200 Subject: Make conflicting targets check less strict People tend to "turn off debug and release builds" by just not building one of the variants. For example, Qt's own rcc is built in release only, however it is configured for debug_and_release with the same TARGET for both. Let qmake complain about conflicting TARGETs only we're about to build all of those conflicting targets, i.e. if build_all is set. Change-Id: I0448bf5cb421e2d801d3cc30e0d80353fba0d999 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- .../tools/qmake/testdata/conflicting_targets/conflicting_targets.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro index c3e8034e35..bd0d4d824a 100644 --- a/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro +++ b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro @@ -1,5 +1,5 @@ TEMPLATE = app -CONFIG += debug_and_release +CONFIG += debug_and_release build_all TARGET = bah DESTDIR = shu SOURCES += main.cpp -- cgit v1.2.3 From de182ea0be4dd5f9ca6552e4b81e80ab43b26be3 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 9 Jan 2019 14:17:35 +0100 Subject: Add libfuzzer test for QTextDocument::setMarkdown() Change-Id: I729d4a3bb276523011a6f17a800e72aa34540e47 Reviewed-by: Edward Welbourne Reviewed-by: Shawn Rutledge --- .../gui/text/qtextdocument/setMarkdown/main.cpp | 34 ++++++++++++++++++++++ .../text/qtextdocument/setMarkdown/setMarkdown.pro | 4 +++ 2 files changed, 38 insertions(+) create mode 100644 tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp create mode 100644 tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro (limited to 'tests') diff --git a/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp new file mode 100644 index 0000000000..acdd91e06e --- /dev/null +++ b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) { + QTextDocument().setMarkdown(QByteArray(Data, Size)); + return 0; +} diff --git a/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro new file mode 100644 index 0000000000..4a2dfa51b9 --- /dev/null +++ b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro @@ -0,0 +1,4 @@ +CONFIG += console +CONFIG -= app_bundle +SOURCES += main.cpp +LIBS += -fsanitize=fuzzer -- cgit v1.2.3 From 0768a28fbfe4c7227182b6b4b7cacbc6772c54f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 3 Oct 2019 12:36:56 +0200 Subject: Remove CFBundleGetInfoString from Info.plist templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Is't been deprecated since Mac OS X 10.5. Task-number: QTBUG-74872 Change-Id: I8b1ad7aca6448883cb164fd0c4b329592ca60548 Reviewed-by: Edward Welbourne Reviewed-by: Alexandru Croitor Reviewed-by: Tor Arne Vestbø --- tests/auto/corelib/io/qdir/Info.plist | 2 -- tests/auto/other/macplist/tst_macplist.cpp | 10 ---------- 2 files changed, 12 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdir/Info.plist b/tests/auto/corelib/io/qdir/Info.plist index 7dc5622bde..e1f6fbe24a 100644 --- a/tests/auto/corelib/io/qdir/Info.plist +++ b/tests/auto/corelib/io/qdir/Info.plist @@ -6,8 +6,6 @@ ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleGetInfoString - Created by Qt/QMake CFBundleIconFile ${ASSETCATALOG_COMPILER_APPICON_NAME} CFBundleIdentifier diff --git a/tests/auto/other/macplist/tst_macplist.cpp b/tests/auto/other/macplist/tst_macplist.cpp index 755cc462f5..dec63b1b66 100644 --- a/tests/auto/other/macplist/tst_macplist.cpp +++ b/tests/auto/other/macplist/tst_macplist.cpp @@ -59,8 +59,6 @@ void tst_MacPlist::test_plist_data() " \n" " CFBundlePackageType\n" " APPL\n" -" CFBundleGetInfoString\n" -" Created by Qt/QMake\n" " CFBundleExecutable\n" " app\n" " CFBundleIdentifier\n" @@ -77,8 +75,6 @@ void tst_MacPlist::test_plist_data() " \n" " CFBundlePackageType\n" " APPL\n" -" CFBundleGetInfoString\n" -" Created by Qt/QMake\n" " CFBundleExecutable\n" " app\n" " CFBundleIdentifier\n" @@ -97,8 +93,6 @@ void tst_MacPlist::test_plist_data() " \n" " CFBundlePackageType\n" " APPL\n" -" CFBundleGetInfoString\n" -" Created by Qt/QMake\n" " CFBundleExecutable\n" " app\n" " CFBundleIdentifier\n" @@ -117,8 +111,6 @@ void tst_MacPlist::test_plist_data() " \n" " CFBundlePackageType\n" " APPL\n" -" CFBundleGetInfoString\n" -" Created by Qt/QMake\n" " CFBundleExecutable\n" " app\n" " CFBundleIdentifier\n" @@ -137,8 +129,6 @@ void tst_MacPlist::test_plist_data() " \n" " CFBundlePackageType\n" " APPL\n" -" CFBundleGetInfoString\n" -" Created by Qt/QMake\n" " CFBundleExecutable\n" " app\n" " CFBundleIdentifier\n" -- cgit v1.2.3