diff options
Diffstat (limited to 'tests/auto/tools/rcc')
-rw-r--r-- | tests/auto/tools/rcc/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/tools/rcc/CMakeLists.txt | 14 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/depfile/simple.d.expected32 | 2 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/images/images.expected | 42 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/images/images.expected32 | 49 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-0.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-1.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected | 56 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 | 45 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected | 28 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected32 | 26 | ||||
-rw-r--r-- | tests/auto/tools/rcc/tst_rcc.cpp | 43 |
12 files changed, 203 insertions, 140 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 abcf3a1f60..96863c49bd 100644 --- a/tests/auto/tools/rcc/CMakeLists.txt +++ b/tests/auto/tools/rcc/CMakeLists.txt @@ -1,9 +1,16 @@ -# Generated from rcc.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_rcc Test: ##################################################################### +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 @@ -63,3 +70,8 @@ qt_internal_add_resource(tst_rcc "size-1" FILES ${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/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/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 366cd20e33..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 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 1d47fa5d30..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 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/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp index 9f4960fc7c..88a6e17e2f 100644 --- a/tests/auto/tools/rcc/tst_rcc.cpp +++ b/tests/auto/tools/rcc/tst_rcc.cpp @@ -1,31 +1,6 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com> +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QLibraryInfo> @@ -139,7 +114,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")); @@ -236,8 +211,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; @@ -301,8 +276,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 @@ -498,7 +473,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()); } |