summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-05 01:01:05 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-05 01:01:06 +0200
commit327b305e95187fda869c5af407e78a17e0e381cd (patch)
treefc51c7579a9c1fed3c3993ac2ea68bf9dd32f8bb /tests
parentda284ef10e0ef80776b9fc9b7bb0e6dc8d71ba63 (diff)
parenta2e718a71abad719ea196e9dc4d90d9267102f54 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp13
-rw-r--r--tests/auto/corelib/io/qdir/Info.plist2
-rw-r--r--tests/auto/other/macplist/tst_macplist.cpp10
-rw-r--r--tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro2
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp34
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro4
6 files changed, 51 insertions, 14 deletions
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<float>("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<int>("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)
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 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
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()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -77,8 +75,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -97,8 +93,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -117,8 +111,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -137,8 +129,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
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
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 <QTextDocument>
+
+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