diff options
Diffstat (limited to 'tests/libfuzzer')
42 files changed, 173 insertions, 523 deletions
diff --git a/tests/libfuzzer/README b/tests/libfuzzer/README index 303fb9024a..33aa309670 100644 --- a/tests/libfuzzer/README +++ b/tests/libfuzzer/README @@ -19,7 +19,7 @@ To run a test with libFuzzer: 3. Configure Qt with -platform linux-clang -sanitize fuzzer-no-link or, if you are using clang 5 - -platform linux-clang -coverage trace-pc-guard + -platform linux-clang -- -DCMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard to add the needed code coverage instrumentation. Since speed of execution is crucial for fuzz testing, it's recommendable to also use the switches -release -static diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt index 5c3ee2064b..bb614575d6 100644 --- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt +++ b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(next LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(next main.cpp diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp index 118f402a15..19001628b2 100644 --- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp +++ b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QCborStreamReader> diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro deleted file mode 100644 index 6c988c2434..0000000000 --- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/next.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt index 0c94541e37..1ced99cfc4 100644 --- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt +++ b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(fromcbor LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(fromcbor main.cpp diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro deleted file mode 100644 index 6c988c2434..0000000000 --- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/fromcbor.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp index 5e2a440d1b..b82b0303ca 100644 --- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp +++ b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QCborValue> diff --git a/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt new file mode 100644 index 0000000000..095c4733e4 --- /dev/null +++ b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) +project(fromjson LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt6 REQUIRED COMPONENTS Core) + +qt_add_executable(fromjson + main.cpp +) + +target_link_libraries(fromjson PUBLIC + Qt::Core +) +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + target_link_libraries(fromjson PRIVATE + $ENV{LIB_FUZZING_ENGINE} + ) +else() + target_link_libraries(fromjson PRIVATE + -fsanitize=fuzzer + ) +endif() diff --git a/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp new file mode 100644 index 0000000000..dec863fd2b --- /dev/null +++ b/tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QJsonDocument> + +extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) { + QJsonDocument::fromJson(QByteArray::fromRawData(Data, Size)); + return 0; +} diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt index 96fd5790a2..4ab7142d8e 100644 --- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt +++ b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(extractionoperator-float LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(extractionoperator-float main.cpp diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro deleted file mode 100644 index 6c988c2434..0000000000 --- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/extractionoperator-float.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp index 10d5c3222e..01a80ab293 100644 --- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp +++ b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTextStream> diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt index aa9b550ed3..642b862da7 100644 --- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt +++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(readnext LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(readnext main.cpp diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp index 7b73e6e952..b1f6dc5e50 100644 --- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp +++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2018 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$ -** -****************************************************************************/ +// Copyright (C) 2018 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QXmlStreamReader> diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro deleted file mode 100644 index 6c988c2434..0000000000 --- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/readnext.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt index 350fbfd692..fcacd7c67d 100644 --- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt +++ b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(optimize LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(optimize main.cpp diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp b/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp index 30a714c250..335b6c0552 100644 --- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp +++ b/tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QRegularExpression> diff --git a/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro b/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro deleted file mode 100644 index 196aca42eb..0000000000 --- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/optimize.pro +++ /dev/null @@ -1,8 +0,0 @@ -QT -= gui -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt index 33154bb562..b4ffa66760 100644 --- a/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt +++ b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(fromstring LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(fromstring main.cpp diff --git a/tests/libfuzzer/corelib/time/qdatetime/fromstring/fromstring.pro b/tests/libfuzzer/corelib/time/qdatetime/fromstring/fromstring.pro deleted file mode 100644 index 631fcd71e4..0000000000 --- a/tests/libfuzzer/corelib/time/qdatetime/fromstring/fromstring.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG -= app_bundle -CONFIG += console -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp b/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp index ba1ddb081f..a0bbe9b03d 100644 --- a/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp +++ b/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QDateTime> @@ -101,7 +76,7 @@ extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System::Gregorian)); for (int sys = int(QCalendar::System::Julian); sys <= int(QCalendar::System::Last); ++sys) - QDateTime::fromString(userString, formats[0], QCalendar(sys)); + QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System(sys))); for (const auto &format : formats) { #ifdef LOG_FORMAT diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt index 168d9f95b9..ceb2f673e8 100644 --- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt +++ b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(result LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,7 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(result main.cpp diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp b/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp index 71780898bc..738da38e29 100644 --- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp +++ b/tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QCryptographicHash> diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro b/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro deleted file mode 100644 index 6c988c2434..0000000000 --- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/result.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT -= gui -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/image/qimage/loadfromdata/CMakeLists.txt b/tests/libfuzzer/gui/image/qimage/loadfromdata/CMakeLists.txt index 5a573b21ce..9c97294077 100644 --- a/tests/libfuzzer/gui/image/qimage/loadfromdata/CMakeLists.txt +++ b/tests/libfuzzer/gui/image/qimage/loadfromdata/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(loadfromdata LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 REQUIRED COMPONENTS Core Gui) qt_add_executable(loadfromdata main.cpp diff --git a/tests/libfuzzer/gui/image/qimage/loadfromdata/loadfromdata.pro b/tests/libfuzzer/gui/image/qimage/loadfromdata/loadfromdata.pro deleted file mode 100644 index 204bd6569d..0000000000 --- a/tests/libfuzzer/gui/image/qimage/loadfromdata/loadfromdata.pro +++ /dev/null @@ -1,12 +0,0 @@ -QT += gui -!isEmpty(QT.svg.name) { - QT += svg -} -QTPLUGIN *= qminimal -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/image/qimage/loadfromdata/main.cpp b/tests/libfuzzer/gui/image/qimage/loadfromdata/main.cpp index 54d1ed0ee6..951b8f4637 100644 --- a/tests/libfuzzer/gui/image/qimage/loadfromdata/main.cpp +++ b/tests/libfuzzer/gui/image/qimage/loadfromdata/main.cpp @@ -1,36 +1,8 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only -#include <QBuffer> #include <QGuiApplication> #include <QImage> -#include <QImageReader> -#include <QSize> #include <QtGlobal> // silence warnings @@ -44,12 +16,6 @@ extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) { static char arg3[] = "minimal"; static char *argv[] = {arg1, arg2, arg3, nullptr}; static QGuiApplication qga(argc, argv); - QByteArray input(QByteArray::fromRawData(Data, Size)); - QBuffer buf(&input); - const QSize size = QImageReader(&buf).size(); - // Don't try to load huge valid images. - // They are justified in using huge memory. - if (!size.isValid() || uint64_t(size.width()) * size.height() < 64 * 1024 * 1024) - QImage().loadFromData(input); + QImage().loadFromData(QByteArray::fromRawData(Data, Size)); return 0; } diff --git a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/CMakeLists.txt b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/CMakeLists.txt index 788a15bd99..808d4e435c 100644 --- a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/CMakeLists.txt +++ b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(fromiccprofile LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 REQUIRED COMPONENTS Core Gui) qt_add_executable(fromiccprofile main.cpp diff --git a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/fromiccprofile.pro b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/fromiccprofile.pro deleted file mode 100644 index bed2198e0d..0000000000 --- a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/fromiccprofile.pro +++ /dev/null @@ -1,9 +0,0 @@ -QT += gui -QTPLUGIN *= qminimal -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp index 943f85d92e..3b9e843405 100644 --- a/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp +++ b/tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/main.cpp @@ -1,35 +1,27 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <cstdlib> #include <QGuiApplication> +#include <QColor> #include <QColorSpace> +#include <QImage> + +static QImage::Format toFormat(QColorSpace::ColorModel model) +{ + switch (model) { + case QColorSpace::ColorModel::Rgb: + return QImage::Format_RGB32; + case QColorSpace::ColorModel::Gray: + return QImage::Format_Grayscale16; + case QColorSpace::ColorModel::Cmyk: + return QImage::Format_CMYK8888; + case QColorSpace::ColorModel::Undefined: + break; + } + return QImage::Format_Invalid; +} extern "C" int LLVMFuzzerTestOneInput(const char *data, size_t size) { // to reduce noise and increase speed @@ -43,5 +35,27 @@ extern "C" int LLVMFuzzerTestOneInput(const char *data, size_t size) { static char *argv[] = {arg1, arg2, arg3, nullptr}; static QGuiApplication qga(argc, argv); QColorSpace cs = QColorSpace::fromIccProfile(QByteArray::fromRawData(data, size)); + if (cs.isValid()) { + cs.description(); + QColorTransform trans1 = cs.transformationToColorSpace(QColorSpace::SRgb); + trans1.isIdentity(); + QColorSpace cs2 = cs; + cs2.setDescription("Hello"); + bool b = (cs == cs2); + Q_UNUSED(b); + QColor color(0xfaf8fa00); + color = trans1.map(color); + QImage img(16, 2, toFormat(cs.colorModel())); + img.setColorSpace(cs); + QImage img2 = img.convertedToColorSpace(QColorSpace::SRgb); + if (cs.isValidTarget()) { + QImage img3 = img2.convertedToColorSpace(cs); + + QColorTransform trans2 = QColorSpace(QColorSpace::SRgb).transformationToColorSpace(cs); + bool a = (trans1 == trans2); + Q_UNUSED(a); + color = trans2.map(color); + } + } return 0; } diff --git a/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt index d4777c1096..906ee30384 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextdocument/sethtml/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(sethtml LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 REQUIRED COMPONENTS Core Gui) qt_add_executable(sethtml main.cpp diff --git a/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp index 3e8af5d98b..6cac5d20ec 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp +++ b/tests/libfuzzer/gui/text/qtextdocument/sethtml/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGuiApplication> #include <QTextDocument> diff --git a/tests/libfuzzer/gui/text/qtextdocument/sethtml/sethtml.pro b/tests/libfuzzer/gui/text/qtextdocument/sethtml/sethtml.pro deleted file mode 100644 index bed2198e0d..0000000000 --- a/tests/libfuzzer/gui/text/qtextdocument/sethtml/sethtml.pro +++ /dev/null @@ -1,9 +0,0 @@ -QT += gui -QTPLUGIN *= qminimal -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt index 2d1d45ed86..0fdf3dfaf8 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(setmarkdown LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 REQUIRED COMPONENTS Core Gui) qt_add_executable(setmarkdown main.cpp diff --git a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp index 983fe60ce9..d9678d5453 100644 --- a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp +++ b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGuiApplication> #include <QTextDocument> diff --git a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/setmarkdown.pro b/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/setmarkdown.pro deleted file mode 100644 index bed2198e0d..0000000000 --- a/tests/libfuzzer/gui/text/qtextdocument/setmarkdown/setmarkdown.pro +++ /dev/null @@ -1,9 +0,0 @@ -QT += gui -QTPLUGIN *= qminimal -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt index 4a593d328a..468b37a8f9 100644 --- a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt +++ b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(beginlayout LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 REQUIRED COMPONENTS Core Gui) qt_add_executable(beginlayout main.cpp diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/beginlayout.pro b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/beginlayout.pro deleted file mode 100644 index bed2198e0d..0000000000 --- a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/beginlayout.pro +++ /dev/null @@ -1,9 +0,0 @@ -QT += gui -QTPLUGIN *= qminimal -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/main.cpp b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/main.cpp index 27e0566c2c..ae6d84bd5c 100644 --- a/tests/libfuzzer/gui/text/qtextlayout/beginlayout/main.cpp +++ b/tests/libfuzzer/gui/text/qtextlayout/beginlayout/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QGuiApplication> #include <QTextLayout> diff --git a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/CMakeLists.txt b/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/CMakeLists.txt index f87344361c..d7c4f0a2f7 100644 --- a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/CMakeLists.txt +++ b/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) project(pem LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -7,8 +10,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Network) +find_package(Qt6 REQUIRED COMPONENTS Core Network) qt_add_executable(pem main.cpp diff --git a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/main.cpp b/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/main.cpp index d41ba36545..4baf3df357 100644 --- a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/main.cpp +++ b/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/main.cpp @@ -1,36 +1,11 @@ -/**************************************************************************** -** -** 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. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QSslCertificate> extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) { // to reduce noise and increase speed - static char quiet[] = "QT_LOGGING_RULES=qt.network.ssl=false"; + static char quiet[] = "QT_LOGGING_RULES=qt.*=false"; static int pe = putenv(quiet); Q_UNUSED(pe); QSslCertificate ssl(QByteArray::fromRawData(Data, Size), QSsl::Pem); diff --git a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/pem.pro b/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/pem.pro deleted file mode 100644 index 7f3781eaba..0000000000 --- a/tests/libfuzzer/network/ssl/qsslcertificate/qsslcertificate/pem/pem.pro +++ /dev/null @@ -1,11 +0,0 @@ -QT -= gui -QT += network -CONFIG += console -CONFIG -= app_bundle -SOURCES += main.cpp -FUZZ_ENGINE = $$(LIB_FUZZING_ENGINE) -isEmpty(FUZZ_ENGINE) { - QMAKE_LFLAGS += -fsanitize=fuzzer -} else { - LIBS += $$FUZZ_ENGINE -} |