From 75cdbb85ea71da1d98e073afcc2dbc18a7d10178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 28 May 2021 20:40:27 +0200 Subject: Fuzzing: Discard logging output from QTextDocument It's pointless in a fuzzer and slows down execution. Change-Id: I160d7fd761118f9eba9b98fc024aef293e021845 Reviewed-by: Shawn Rutledge --- tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp | 7 ++++++- tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/libfuzzer/gui') 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 #include +#include + +// 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 #include +#include + +// 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; -- cgit v1.2.3