summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer/gui
diff options
context:
space:
mode:
authorRobert Löhning <robert.loehning@qt.io>2021-05-28 20:40:27 +0200
committerRobert Löhning <robert.loehning@qt.io>2021-05-31 17:10:58 +0200
commit75cdbb85ea71da1d98e073afcc2dbc18a7d10178 (patch)
treed8541c05e958a01fc03b10a19d6b52f1e6c0fa3d /tests/libfuzzer/gui
parent33a2bd9ca9ee3dc05e5f7cb48aa8f1d55f5368b2 (diff)
Fuzzing: Discard logging output from QTextDocument
It's pointless in a fuzzer and slows down execution. Change-Id: I160d7fd761118f9eba9b98fc024aef293e021845 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/libfuzzer/gui')
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp7
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp
index ed2a5c4e37..3e8af5d98b 100644
--- a/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp
+++ b/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -28,6 +28,11 @@
#include <QGuiApplication>
#include <QTextDocument>
+#include <QtGlobal>
+
+// silence warnings
+static QtMessageHandler mh = qInstallMessageHandler([](QtMsgType, const QMessageLogContext &,
+ const QString &) {});
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
static int argc = 3;
diff --git a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp
index 6093da9827..983fe60ce9 100644
--- a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp
+++ b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -28,6 +28,11 @@
#include <QGuiApplication>
#include <QTextDocument>
+#include <QtGlobal>
+
+// silence warnings
+static QtMessageHandler mh = qInstallMessageHandler([](QtMsgType, const QMessageLogContext &,
+ const QString &) {});
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
static int argc = 3;