summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libfuzzer/corelib')
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborstreamreader/next/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/CMakeLists.txt30
-rw-r--r--tests/libfuzzer/corelib/serialization/qjsondocument/fromjson/main.cpp9
-rw-r--r--tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/text/qregularexpression/optimize/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp29
-rw-r--r--tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt5
-rw-r--r--tests/libfuzzer/corelib/tools/qcryptographichash/result/main.cpp29
16 files changed, 81 insertions, 196 deletions
diff --git a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
index 7858cdaf03..bb614575d6 100644
--- a/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/serialization/qcborstreamreader/next/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(next LANGUAGES CXX)
@@ -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 1da0a21f5a..1ced99cfc4 100644
--- a/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/serialization/qcborvalue/fromcbor/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(fromcbor LANGUAGES CXX)
@@ -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 72cfd09277..4ab7142d8e 100644
--- a/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/serialization/qtextstream/extractionoperator-float/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(extractionoperator-float LANGUAGES CXX)
@@ -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 79c88970b3..642b862da7 100644
--- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(readnext LANGUAGES CXX)
@@ -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/text/qregularexpression/optimize/CMakeLists.txt b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
index d31e48188a..fcacd7c67d 100644
--- a/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/text/qregularexpression/optimize/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(optimize LANGUAGES CXX)
@@ -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/time/qdatetime/fromstring/CMakeLists.txt b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
index adec286291..b4ffa66760 100644
--- a/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/time/qdatetime/fromstring/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(fromstring LANGUAGES CXX)
@@ -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/main.cpp b/tests/libfuzzer/corelib/time/qdatetime/fromstring/main.cpp
index 31b1c414a3..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>
diff --git a/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
index 1e4ebc9b75..ceb2f673e8 100644
--- a/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
+++ b/tests/libfuzzer/corelib/tools/qcryptographichash/result/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(result LANGUAGES CXX)
@@ -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>