summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/rcc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools/rcc')
-rw-r--r--tests/auto/tools/rcc/BLACKLIST2
-rw-r--r--tests/auto/tools/rcc/CMakeLists.txt41
-rw-r--r--tests/auto/tools/rcc/data/.gitattributes2
-rw-r--r--tests/auto/tools/rcc/data/depfile/simple.d.expected322
-rw-r--r--tests/auto/tools/rcc/data/images/images.expected42
-rw-r--r--tests/auto/tools/rcc/data/images/images.expected3249
-rw-r--r--tests/auto/tools/rcc/data/legal/legal.qrc10
-rw-r--r--tests/auto/tools/rcc/data/legal/rcc_legal.cpp101
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-0.expected18
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-1.expected18
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected56
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected3245
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected30
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected3228
-rw-r--r--tests/auto/tools/rcc/rcc.pro12
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp63
16 files changed, 342 insertions, 177 deletions
diff --git a/tests/auto/tools/rcc/BLACKLIST b/tests/auto/tools/rcc/BLACKLIST
deleted file mode 100644
index 367fc3b94c..0000000000
--- a/tests/auto/tools/rcc/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-# QTBUG-85364
-b2qt cmake
diff --git a/tests/auto/tools/rcc/CMakeLists.txt b/tests/auto/tools/rcc/CMakeLists.txt
index 06d62244ff..96863c49bd 100644
--- a/tests/auto/tools/rcc/CMakeLists.txt
+++ b/tests/auto/tools/rcc/CMakeLists.txt
@@ -1,22 +1,29 @@
-# Generated from rcc.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_rcc Test:
#####################################################################
-qt_add_test(tst_rcc
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_rcc LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
+qt_internal_add_test(tst_rcc
SOURCES
tst_rcc.cpp
)
# Resources:
set(images_resource_files
- "images/circle.png"
- "images/square.png"
- "images/subdir/triangle.png"
+ "data/images/images/circle.png"
+ "data/images/images/square.png"
+ "data/images/images/subdir/triangle.png"
)
-qt_add_resource(tst_rcc "images"
+qt_internal_add_resource(tst_rcc "images"
PREFIX
"/"
BASE
@@ -25,10 +32,10 @@ qt_add_resource(tst_rcc "images"
${images_resource_files}
)
set(size-0_resource_files
- "data/data-0.txt"
+ "data/sizes/data/data-0.txt"
)
-qt_add_resource(tst_rcc "size-0"
+qt_internal_add_resource(tst_rcc "size-0"
PREFIX
"/"
BASE
@@ -37,13 +44,13 @@ qt_add_resource(tst_rcc "size-0"
${size-0_resource_files}
)
set(size-2-0-35-1_resource_files
- "data/data-0.txt"
- "data/data-1.txt"
- "data/data-2.txt"
- "data/data-35.txt"
+ "data/sizes/data/data-0.txt"
+ "data/sizes/data/data-1.txt"
+ "data/sizes/data/data-2.txt"
+ "data/sizes/data/data-35.txt"
)
-qt_add_resource(tst_rcc "size-2-0-35-1"
+qt_internal_add_resource(tst_rcc "size-2-0-35-1"
PREFIX
"/"
BASE
@@ -52,10 +59,10 @@ qt_add_resource(tst_rcc "size-2-0-35-1"
${size-2-0-35-1_resource_files}
)
set(size-1_resource_files
- "data/data-1.txt"
+ "data/sizes/data/data-1.txt"
)
-qt_add_resource(tst_rcc "size-1"
+qt_internal_add_resource(tst_rcc "size-1"
PREFIX
"/"
BASE
@@ -64,3 +71,7 @@ qt_add_resource(tst_rcc "size-1"
${size-1_resource_files}
)
+# Add dependencies that are implicitly used inside the test
+add_dependencies(tst_rcc
+ Qt::rcc
+)
diff --git a/tests/auto/tools/rcc/data/.gitattributes b/tests/auto/tools/rcc/data/.gitattributes
new file mode 100644
index 0000000000..89d6e8fe1c
--- /dev/null
+++ b/tests/auto/tools/rcc/data/.gitattributes
@@ -0,0 +1,2 @@
+# Keep parentdir.txt with LF line endings
+parentdir.txt -text
diff --git a/tests/auto/tools/rcc/data/depfile/simple.d.expected32 b/tests/auto/tools/rcc/data/depfile/simple.d.expected32
index a89b61bdc7..4b7aad56b1 100644
--- a/tests/auto/tools/rcc/data/depfile/simple.d.expected32
+++ b/tests/auto/tools/rcc/data/depfile/simple.d.expected32
@@ -1 +1 @@
-simple.qrc.cpp: ../images/images/circle.png ../images/images/square.png
+simple.qrc.cpp: ../images/images/square.png ../images/images/circle.png
diff --git a/tests/auto/tools/rcc/data/images/images.expected b/tests/auto/tools/rcc/data/images/images.expected
index b3b43e6e6f..b30c6ce623 100644
--- a/tests/auto/tools/rcc/data/images/images.expected
+++ b/tests/auto/tools/rcc/data/images/images.expected
@@ -1,13 +1,18 @@
/****************************************************************************
** Resource object code
**
-IGNORE: ** Created by: The Resource Compiler for Qt version 6.0.0
+IGNORE:** Created by: The Resource Compiler for Qt version 6.3.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/square.png
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/square.png
0x0,0x0,0x0,0x5e,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -16,7 +21,7 @@ IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/square.png
0x1f,0xab,0x0,0x0,0x0,0x13,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x0,0x81,
0xfa,0xff,0xff,0xff,0xd,0x3e,0x2,0x4,0x0,0x8d,0x4d,0x68,0x6b,0xcf,0xb8,0x8e,
0x86,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
0x0,0x0,0x0,0xa5,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -30,7 +35,7 @@ IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
0x4c,0x48,0x31,0x15,0x53,0xec,0x5,0x14,0x9b,0x11,0xc5,0x6e,0x8,0xdd,0x8e,0x1b,
0x14,0x54,0x19,0xf3,0xa1,0x23,0xdb,0xd5,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
0xae,0x42,0x60,0x82,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/subdir/triangle.png
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/subdir/triangle.png
0x0,0x0,0x0,0xaa,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -53,6 +58,11 @@ static const unsigned char qt_resource_name[] = {
0x7,0x3,0x7d,0xc3,
0x0,0x69,
0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
+ // subdir
+ 0x0,0x6,
+ 0x7,0xab,0x8b,0x2,
+ 0x0,0x73,
+ 0x0,0x75,0x0,0x62,0x0,0x64,0x0,0x69,0x0,0x72,
// square.png
0x0,0xa,
0x8,0x8b,0x6,0x27,
@@ -63,11 +73,6 @@ static const unsigned char qt_resource_name[] = {
0xa,0x2d,0x16,0x47,
0x0,0x63,
0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
- // subdir
- 0x0,0x6,
- 0x7,0xab,0x8b,0x2,
- 0x0,0x73,
- 0x0,0x75,0x0,0x62,0x0,0x64,0x0,0x69,0x0,0x72,
// triangle.png
0x0,0xc,
0x5,0x59,0xa7,0xc7,
@@ -84,13 +89,13 @@ static const unsigned char qt_resource_struct[] = {
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/images/subdir
- 0x0,0x0,0x0,0x46,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
+ 0x0,0x0,0x0,0x12,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/images/square.png
- 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ 0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
TIMESTAMP:images/square.png
// :/images/circle.png
- 0x0,0x0,0x0,0x2c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x62,
+ 0x0,0x0,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x62,
TIMESTAMP:images/circle.png
// :/images/subdir/triangle.png
0x0,0x0,0x0,0x58,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0xb,
@@ -110,7 +115,9 @@ TIMESTAMP:images/subdir/triangle.png
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
@@ -139,9 +146,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
return 1;
}
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
} dummy;
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/images/images.expected32 b/tests/auto/tools/rcc/data/images/images.expected32
index bc99a13f9f..7e98fdd4fc 100644
--- a/tests/auto/tools/rcc/data/images/images.expected32
+++ b/tests/auto/tools/rcc/data/images/images.expected32
@@ -1,13 +1,27 @@
/****************************************************************************
** Resource object code
**
-IGNORE: ** Created by: The Resource Compiler for Qt version 6.0.0
+IGNORE:** Created by: The Resource Compiler for Qt version 6.3.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/square.png
+ 0x0,0x0,0x0,0x5e,
+ 0x89,
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
+ 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x1,0x3,0x0,0x0,0x0,0x49,0xb4,0xe8,0xb7,
+ 0x0,0x0,0x0,0x6,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x58,0xa8,0xff,0x8c,0x14,
+ 0x1f,0xab,0x0,0x0,0x0,0x13,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x0,0x81,
+ 0xfa,0xff,0xff,0xff,0xd,0x3e,0x2,0x4,0x0,0x8d,0x4d,0x68,0x6b,0xcf,0xb8,0x8e,
+ 0x86,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
0x0,0x0,0x0,0xa5,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -21,16 +35,7 @@ IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
0x4c,0x48,0x31,0x15,0x53,0xec,0x5,0x14,0x9b,0x11,0xc5,0x6e,0x8,0xdd,0x8e,0x1b,
0x14,0x54,0x19,0xf3,0xa1,0x23,0xdb,0xd5,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
0xae,0x42,0x60,0x82,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/square.png
- 0x0,0x0,0x0,0x5e,
- 0x89,
- 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
- 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x1,0x3,0x0,0x0,0x0,0x49,0xb4,0xe8,0xb7,
- 0x0,0x0,0x0,0x6,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x58,0xa8,0xff,0x8c,0x14,
- 0x1f,0xab,0x0,0x0,0x0,0x13,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x0,0x81,
- 0xfa,0xff,0xff,0xff,0xd,0x3e,0x2,0x4,0x0,0x8d,0x4d,0x68,0x6b,0xcf,0xb8,0x8e,
- 0x86,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/subdir/triangle.png
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/subdir/triangle.png
0x0,0x0,0x0,0xaa,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -53,11 +58,6 @@ static const unsigned char qt_resource_name[] = {
0x7,0x3,0x7d,0xc3,
0x0,0x69,
0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
- // circle.png
- 0x0,0xa,
- 0xa,0x2d,0x16,0x47,
- 0x0,0x63,
- 0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
// square.png
0x0,0xa,
0x8,0x8b,0x6,0x27,
@@ -68,6 +68,11 @@ static const unsigned char qt_resource_name[] = {
0x7,0xab,0x8b,0x2,
0x0,0x73,
0x0,0x75,0x0,0x62,0x0,0x64,0x0,0x69,0x0,0x72,
+ // circle.png
+ 0x0,0xa,
+ 0xa,0x2d,0x16,0x47,
+ 0x0,0x63,
+ 0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
// triangle.png
0x0,0xc,
0x5,0x59,0xa7,0xc7,
@@ -84,13 +89,13 @@ static const unsigned char qt_resource_struct[] = {
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/images/subdir
- 0x0,0x0,0x0,0x46,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
+ 0x0,0x0,0x0,0x2c,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/images/square.png
- 0x0,0x0,0x0,0x2c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xa9,
+ 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
TIMESTAMP:images/square.png
// :/images/circle.png
- 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ 0x0,0x0,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x62,
TIMESTAMP:images/circle.png
// :/images/subdir/triangle.png
0x0,0x0,0x0,0x58,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0xb,
@@ -110,7 +115,9 @@ TIMESTAMP:images/subdir/triangle.png
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
diff --git a/tests/auto/tools/rcc/data/legal/legal.qrc b/tests/auto/tools/rcc/data/legal/legal.qrc
new file mode 100644
index 0000000000..5eb7f58416
--- /dev/null
+++ b/tests/auto/tools/rcc/data/legal/legal.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <legal>
+ Copyright (C) 2024 Intel Corporation.
+ SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+ </legal>
+ <qresource>
+ <file>../parentdir.txt</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/legal/rcc_legal.cpp b/tests/auto/tools/rcc/data/legal/rcc_legal.cpp
new file mode 100644
index 0000000000..deec3380aa
--- /dev/null
+++ b/tests/auto/tools/rcc/data/legal/rcc_legal.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+** Resource object code
+** Copyright (C) 2024 Intel Corporation.
+** SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+**
+** Created by: The Resource Compiler for Qt version 6.9.0
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
+static const unsigned char qt_resource_data[] = {
+ // parentdir.txt
+ 0x0,0x0,0x0,0x1a,
+ 0x61,
+ 0x62,0x63,0x64,0x65,0x66,0x67,0x69,0x68,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,
+ 0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0xa,
+
+};
+
+static const unsigned char qt_resource_name[] = {
+ // parentdir.txt
+ 0x0,0xd,
+ 0x6,0x14,0xd1,0x74,
+ 0x0,0x70,
+ 0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x64,0x0,0x69,0x0,0x72,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+
+};
+
+static const unsigned char qt_resource_struct[] = {
+ // :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/parentdir.txt
+ 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+TIMESTAMP:../parentdir.txt
+
+};
+
+#ifdef QT_NAMESPACE
+# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
+# define QT_RCC_MANGLE_NAMESPACE0(x) x
+# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+ QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+# define QT_RCC_PREPEND_NAMESPACE(name) name
+# define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
+namespace QT_NAMESPACE {
+#endif
+
+bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+#ifdef QT_NAMESPACE
+}
+#endif
+
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)();
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)();
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
+namespace {
+ struct initializer {
+ initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
+ ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
+ } dummy;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/sizes/size-0.expected b/tests/auto/tools/rcc/data/sizes/size-0.expected
index 2f70a607ab..79defe7868 100644
--- a/tests/auto/tools/rcc/data/sizes/size-0.expected
+++ b/tests/auto/tools/rcc/data/sizes/size-0.expected
@@ -6,6 +6,11 @@ IGNORE: ** Created by: The Resource Compiler for Qt version 5.11.2
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt
0x0,0x0,0x0,0x0,
@@ -52,7 +57,9 @@ TIMESTAMP:data/data-0.txt
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
@@ -81,9 +88,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
return 1;
}
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
} dummy;
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/sizes/size-1.expected b/tests/auto/tools/rcc/data/sizes/size-1.expected
index d1717a9255..925de99c32 100644
--- a/tests/auto/tools/rcc/data/sizes/size-1.expected
+++ b/tests/auto/tools/rcc/data/sizes/size-1.expected
@@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 5.11.2
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt
0x0,0x0,0x0,0x1,
@@ -53,7 +58,9 @@ TIMESTAMP:data/data-1.txt
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
@@ -82,9 +89,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
return 1;
}
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
} dummy;
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected
index f2c81fedf2..d858e15dba 100644
--- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected
+++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected
@@ -1,29 +1,34 @@
/****************************************************************************
** Resource object code
**
-IGNORE: ** Created by: The Resource Compiler for Qt version 6.0.0
+IGNORE:** Created by: The Resource Compiler for Qt version 6.3.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-35.txt
- 0x0,0x0,0x0,0x23,
- 0x30,
- 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,
- 0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,
- 0x31,0x32,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt
0x0,0x0,0x0,0x2,
0x30,
0x31,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt
0x0,0x0,0x0,0x1,
0x40,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt
0x0,0x0,0x0,0x0,
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-35.txt
+ 0x0,0x0,0x0,0x23,
+ 0x30,
+ 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,
+ 0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,
+ 0x31,0x32,
};
@@ -33,11 +38,6 @@ static const unsigned char qt_resource_name[] = {
0x0,0x6,0xa8,0xa1,
0x0,0x64,
0x0,0x61,0x0,0x74,0x0,0x61,
- // data-35.txt
- 0x0,0xb,
- 0x0,0xb5,0x4f,0x74,
- 0x0,0x64,
- 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x33,0x0,0x35,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
// data-2.txt
0x0,0xa,
0x4,0x8,0xa,0xb4,
@@ -53,6 +53,11 @@ static const unsigned char qt_resource_name[] = {
0x4,0xe,0xa,0xb4,
0x0,0x64,
0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x30,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // data-35.txt
+ 0x0,0xb,
+ 0x0,0xb5,0x4f,0x74,
+ 0x0,0x64,
+ 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x33,0x0,0x35,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
};
@@ -64,16 +69,16 @@ static const unsigned char qt_resource_struct[] = {
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x2,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/data/data-35.txt
- 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ 0x0,0x0,0x0,0x5c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xf,
TIMESTAMP:data/data-35.txt
// :/data/data-2.txt
- 0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x27,
+ 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
TIMESTAMP:data/data-2.txt
// :/data/data-0.txt
- 0x0,0x0,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x32,
+ 0x0,0x0,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xb,
TIMESTAMP:data/data-0.txt
// :/data/data-1.txt
- 0x0,0x0,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2d,
+ 0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x6,
TIMESTAMP:data/data-1.txt
};
@@ -90,7 +95,9 @@ TIMESTAMP:data/data-1.txt
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
@@ -119,9 +126,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
return 1;
}
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
} dummy;
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32
index 3b5f643986..a67e0ffc6e 100644
--- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32
+++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32
@@ -1,27 +1,32 @@
/****************************************************************************
** Resource object code
**
-IGNORE: ** Created by: The Resource Compiler for Qt version 6.0.0
+IGNORE:** Created by: The Resource Compiler for Qt version 6.3.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
static const unsigned char qt_resource_data[] = {
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-35.txt
- 0x0,0x0,0x0,0x23,
- 0x30,
- 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,
- 0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,
- 0x31,0x32,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt
0x0,0x0,0x0,0x1,
0x40,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt
0x0,0x0,0x0,0x2,
0x30,
0x31,
-IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-35.txt
+ 0x0,0x0,0x0,0x23,
+ 0x30,
+ 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,
+ 0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,
+ 0x31,0x32,
+IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt
0x0,0x0,0x0,0x0,
@@ -33,11 +38,6 @@ static const unsigned char qt_resource_name[] = {
0x0,0x6,0xa8,0xa1,
0x0,0x64,
0x0,0x61,0x0,0x74,0x0,0x61,
- // data-35.txt
- 0x0,0xb,
- 0x0,0xb5,0x4f,0x74,
- 0x0,0x64,
- 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x33,0x0,0x35,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
// data-1.txt
0x0,0xa,
0x4,0x11,0xa,0xb4,
@@ -48,6 +48,11 @@ static const unsigned char qt_resource_name[] = {
0x4,0x8,0xa,0xb4,
0x0,0x64,
0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x32,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // data-35.txt
+ 0x0,0xb,
+ 0x0,0xb5,0x4f,0x74,
+ 0x0,0x64,
+ 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x33,0x0,0x35,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
// data-0.txt
0x0,0xa,
0x4,0xe,0xa,0xb4,
@@ -64,16 +69,16 @@ static const unsigned char qt_resource_struct[] = {
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x2,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/data/data-35.txt
- 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ 0x0,0x0,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xb,
TIMESTAMP:data/data-35.txt
// :/data/data-2.txt
- 0x0,0x0,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2c,
+ 0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
TIMESTAMP:data/data-2.txt
// :/data/data-0.txt
0x0,0x0,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x32,
TIMESTAMP:data/data-0.txt
// :/data/data-1.txt
- 0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x27,
+ 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
TIMESTAMP:data/data-1.txt
};
@@ -90,7 +95,9 @@ TIMESTAMP:data/data-1.txt
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
-#ifdef QT_NAMESPACE
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
namespace QT_NAMESPACE {
#endif
diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected
index 99ef16c226..849e91c012 100644
--- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected
+++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected
@@ -1,16 +1,11 @@
# Resource object code (Python 3)
# Created by: object code
-# Created by: The Resource Compiler for Qt version 6.0.0
+# Created by: The Resource Compiler for Qt version 6.3.0
# WARNING! All changes made in this file will be lost!
-from PySide2 import QtCore
+from PySide6 import QtCore
qt_resource_data = b"\
-\x00\x00\x00#\
-0\
-123456789 012345\
-6789 0123456789 \
-12\
\x00\x00\x00\x02\
0\
1\
@@ -19,6 +14,11 @@ qt_resource_data = b"\
\
\x00\x00\x00\x00\
\
+\x00\x00\x00#\
+0\
+123456789 012345\
+6789 0123456789 \
+12\
"
qt_resource_name = b"\
@@ -26,10 +26,6 @@ qt_resource_name = b"\
\x00\x06\xa8\xa1\
\x00d\
\x00a\x00t\x00a\
-\x00\x0b\
-\x00\xb5Ot\
-\x00d\
-\x00a\x00t\x00a\x00-\x003\x005\x00.\x00t\x00x\x00t\
\x00\x0a\
\x04\x08\x0a\xb4\
\x00d\
@@ -42,6 +38,10 @@ qt_resource_name = b"\
\x04\x0e\x0a\xb4\
\x00d\
\x00a\x00t\x00a\x00-\x000\x00.\x00t\x00x\x00t\
+\x00\x0b\
+\x00\xb5Ot\
+\x00d\
+\x00a\x00t\x00a\x00-\x003\x005\x00.\x00t\x00x\x00t\
"
qt_resource_struct = b"\
@@ -49,13 +49,13 @@ qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
+\x00\x00\x00\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0f\
IGNORE: (time stamp)
-\x00\x00\x00*\x00\x00\x00\x00\x00\x01\x00\x00\x00'\
+\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
IGNORE: (time stamp)
-\x00\x00\x00^\x00\x00\x00\x00\x00\x01\x00\x00\x002\
+\x00\x00\x00B\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0b\
IGNORE: (time stamp)
-\x00\x00\x00D\x00\x00\x00\x00\x00\x01\x00\x00\x00-\
+\x00\x00\x00(\x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\
IGNORE: (time stamp)
"
diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected32 b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected32
index c1c6b29fe8..0fa118d24f 100644
--- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected32
+++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected32
@@ -1,22 +1,22 @@
# Resource object code (Python 3)
# Created by: object code
-# Created by: The Resource Compiler for Qt version 6.0.0
+# Created by: The Resource Compiler for Qt version 6.3.0
# WARNING! All changes made in this file will be lost!
-from PySide2 import QtCore
+from PySide6 import QtCore
qt_resource_data = b"\
-\x00\x00\x00#\
-0\
-123456789 012345\
-6789 0123456789 \
-12\
\x00\x00\x00\x01\
@\
\
\x00\x00\x00\x02\
0\
1\
+\x00\x00\x00#\
+0\
+123456789 012345\
+6789 0123456789 \
+12\
\x00\x00\x00\x00\
\
"
@@ -26,10 +26,6 @@ qt_resource_name = b"\
\x00\x06\xa8\xa1\
\x00d\
\x00a\x00t\x00a\
-\x00\x0b\
-\x00\xb5Ot\
-\x00d\
-\x00a\x00t\x00a\x00-\x003\x005\x00.\x00t\x00x\x00t\
\x00\x0a\
\x04\x11\x0a\xb4\
\x00d\
@@ -38,6 +34,10 @@ qt_resource_name = b"\
\x04\x08\x0a\xb4\
\x00d\
\x00a\x00t\x00a\x00-\x002\x00.\x00t\x00x\x00t\
+\x00\x0b\
+\x00\xb5Ot\
+\x00d\
+\x00a\x00t\x00a\x00-\x003\x005\x00.\x00t\x00x\x00t\
\x00\x0a\
\x04\x0e\x0a\xb4\
\x00d\
@@ -49,13 +49,13 @@ qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
+\x00\x00\x00B\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0b\
IGNORE: (time stamp)
-\x00\x00\x00D\x00\x00\x00\x00\x00\x01\x00\x00\x00,\
+\x00\x00\x00(\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\
IGNORE: (time stamp)
\x00\x00\x00^\x00\x00\x00\x00\x00\x01\x00\x00\x002\
IGNORE: (time stamp)
-\x00\x00\x00*\x00\x00\x00\x00\x00\x01\x00\x00\x00'\
+\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
IGNORE: (time stamp)
"
diff --git a/tests/auto/tools/rcc/rcc.pro b/tests/auto/tools/rcc/rcc.pro
deleted file mode 100644
index 3fdc4132a7..0000000000
--- a/tests/auto/tools/rcc/rcc.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-CONFIG += testcase
-QT = core testlib
-TARGET = tst_rcc
-
-SOURCES += tst_rcc.cpp
-
-RESOURCES += \
- $$PWD/data/images/images.qrc \
- $$PWD/data/sizes/size-0.qrc \
- $$PWD/data/sizes/size-2-0-35-1.qrc \
- $$PWD/data/sizes/size-1.qrc
-
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index 26d2862da7..af4a992d5c 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
+// Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>
+// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2024 Intel Corporation.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QTest>
+#include <QLibraryInfo>
#include <QtCore/QString>
#include <QtCore/QCoreApplication>
#include <QtCore/QByteArray>
@@ -103,7 +80,7 @@ private:
void tst_rcc::initTestCase()
{
- m_rcc = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/rcc");
+ m_rcc = QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath) + QLatin1String("/rcc");
m_dataPath = QFINDTESTDATA("data");
QVERIFY(!m_dataPath.isEmpty());
@@ -138,7 +115,7 @@ static QString doCompare(const QStringList &actual, const QStringList &expected,
ba.append("File " + fi.absoluteFilePath().toUtf8() + " does not exist!");
break;
}
- const quint64 timeStamp = quint64(fi.lastModified().toMSecsSinceEpoch());
+ const quint64 timeStamp = quint64(fi.lastModified(QTimeZone::UTC).toMSecsSinceEpoch());
expectedLine.clear();
for (int shift = 56; shift >= 0; shift -= 8) {
expectedLine.append(QLatin1String("0x"));
@@ -172,6 +149,9 @@ void tst_rcc::rcc_data()
QTest::newRow("size-1") << sizesPath << "size-1.qrc" << "size-1.expected";
QTest::newRow("size-2-0-35-1") << sizesPath << "size-2-0-35-1.qrc" <<
(sizeof(size_t) == 8 ? "size-2-0-35-1.expected" : "size-2-0-35-1.expected32");
+
+ QTest::newRow("legal") << m_dataPath + QLatin1StringView("/legal")
+ << "legal.qrc" << "rcc_legal.cpp";
}
static QStringList readLinesFromFile(const QString &fileName,
@@ -180,10 +160,8 @@ static QStringList readLinesFromFile(const QString &fileName,
QFile file(fileName);
bool ok = file.open(QIODevice::ReadOnly | QIODevice::Text);
- if (!ok) {
- QWARN(qPrintable(QString::fromLatin1("Could not open testdata file %1: %2")
- .arg(fileName, file.errorString())));
- }
+ if (!ok)
+ qWarning() << "Could not open testdata file" << fileName << ":" << file.errorString();
return QString::fromUtf8(file.readAll()).split(QLatin1Char('\n'), splitBehavior);
}
@@ -237,8 +215,8 @@ static QStringMap readExpectedFiles(const QString &fileName)
{
QStringMap expectedFiles;
- QStringList lines = readLinesFromFile(fileName, Qt::SkipEmptyParts);
- foreach (const QString &line, lines) {
+ const QStringList lines = readLinesFromFile(fileName, Qt::SkipEmptyParts);
+ for (const QString &line : lines) {
QString resourceFileName = line.section(QLatin1Char(' '), 0, 0, QString::SectionSkipEmpty);
QString actualFileName = line.section(QLatin1Char(' '), 1, 1, QString::SectionSkipEmpty);
expectedFiles[resourceFileName] = actualFileName;
@@ -273,8 +251,7 @@ void tst_rcc::binary_data()
QDirIterator iter(dataPath, QStringList() << QLatin1String("*.qrc"));
while (iter.hasNext())
{
- iter.next();
- QFileInfo qrcFileInfo = iter.fileInfo();
+ QFileInfo qrcFileInfo = iter.nextFileInfo();
QString absoluteBaseName = QFileInfo(qrcFileInfo.absolutePath(), qrcFileInfo.baseName()).absoluteFilePath();
QString rccFileName = absoluteBaseName + QLatin1String(".rcc");
@@ -303,8 +280,8 @@ void tst_rcc::binary_data()
QString localeFileName = absoluteBaseName + QLatin1String(".locale");
QFile localeFile(localeFileName);
if (localeFile.exists()) {
- QStringList locales = readLinesFromFile(localeFileName, Qt::SkipEmptyParts);
- foreach (const QString &locale, locales) {
+ const QStringList locales = readLinesFromFile(localeFileName, Qt::SkipEmptyParts);
+ for (const QString &locale : locales) {
QString expectedFileName = QString::fromLatin1("%1.%2.%3").arg(absoluteBaseName, locale, QLatin1String("expected"));
QStringMap expectedFiles = readExpectedFiles(expectedFileName);
QTest::newRow(qPrintable(qrcFileInfo.baseName() + QLatin1Char('_') + locale)) << rccFileName
@@ -500,7 +477,7 @@ void tst_rcc::cleanupTestCase()
QFileInfoList entries = dataDir.entryInfoList(QStringList() << QLatin1String("*.rcc"));
QDir dataDepDir(m_dataPath + QLatin1String("/depfile"));
entries += dataDepDir.entryInfoList({QLatin1String("*.d"), QLatin1String("*.qrc.cpp")});
- foreach (const QFileInfo &entry, entries)
+ for (const QFileInfo &entry : std::as_const(entries))
QFile::remove(entry.absoluteFilePath());
}