qt5base-lts/tests/auto/tools
Thiago Macieira dda9c9e2bc moc: fix use of escape sequence of more than one character
We had the code to calculate the length, but were improperly using it
only for the offset, not the length of the string or its containing
array. That resulted in the generated moc output containing:

 QT_MOC_LITERAL(111, 5), // "\xffz"
 QT_MOC_LITERAL(114, 5), // "\0012"
 QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName"

The two strings are described as occupying 5 bytes (length 4 + null
terminator), which is incorrect. The offset was correct: 114 - 111 = 3
and 117 - 114 = 3. The new output is:

        QT_MOC_LITERAL(111, 2),  // "\xffz"
        QT_MOC_LITERAL(114, 2),  // "\0012"
        QT_MOC_LITERAL(117, 23),  // "slotWithAReallyLongName"

The effect of the array size calculation would only be felt if moc
decided it needed a second string array (for strings over 65535 bytes),
which would cause the offsets in the second array to be all wrong. There
was no such test until now.

Drive-by fixing of the newline, indentation, and the stale comment
referring to QByteArrayData (Qt 5).

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 13:03:17 -07:00
..
macdeployqt Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
moc moc: fix use of escape sequence of more than one character 2022-06-22 13:03:17 -07:00
qdbuscpp2xml Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qdbusxml2cpp Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qmake Teach qmake about digit-grouping apostrophes in numeric literals 2022-06-17 00:05:53 +02:00
qmakelib Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
rcc Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
uic Make uic generate correct C++ comments 2022-05-18 11:53:26 +02:00
windeployqt Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Exclude tst_qmake if the build of qmake tool is disabled 2022-02-09 15:33:46 +01:00