diff options
Diffstat (limited to 'tests/libfuzzer/corelib/serialization')
10 files changed, 67 insertions, 116 deletions
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/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/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/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> |