summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global
Commit message (Collapse)AuthorAgeFilesLines
* Tests: remove #define COMMAThiago Macieira2022-08-091-6/+7
| | | | | | | | | | Those were workarounds to passing a comma to a macro, but there are ways around it. The simplest is to just use variadic macros; another, which has been applied to Q_DECLARE_METATYPE for a long time, is to define an alias to the thing you're trying to use. Change-Id: Ie4bb662dcb274440ab8bfffd17097fbf0c53eabc Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qputenv: defend against non-NUL-terminated QByteArray valuesMarc Mutz2022-08-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | The old code assumed that a QByteArray's data() is always NUL-terminated. Due to the conflation of owners and non-owners in QByteArray (but also in case we ever get efficient substringing), this is not always the case, e.g. QByteArray::fromRawData() does not ensure NUL-termination. From QString::utf16(), we learn that the condition to check for is QArrayData::isMutable(). After working around the fact that QByteArray::data_ptr() doesn't exist for const QBAs and that empty QBAs always refer to QByteArray::empty_, which is !isMutable(), we can detect this situation and re-allocate without introducing new API. This is the fix for Qt ≤ 6.4. For Qt 6.5, we'll port the function to QByteArrayView. Pick-to: 6.4 6.3 6.2 5.15 Fixes: QTBUG-105302 Change-Id: I3416535ab09d601e0e87b2767f2c024ba1217e64 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0318-0/+54
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QMetaObject: rewrite invokeMethod()Thiago Macieira2022-07-281-3/+13
| | | | | | | | | | | | Use the QMetaMethodPrivate::invokeImpl() function we added in the last commit, without recreating the method signature. Instead, only do a comparison on the method name and allow invokeImpl() to decide whether this method can be called with the given arguments. This will allow invokeImpl() to have more flexibility in deciding if the arguments match, using the stored metatype information. Change-Id: I36b24183fbd041179f2ffffd17021a86484bfab6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-288-8/+8
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* function_ref test: Don't take reference of temporariesMårten Nordheim2022-06-201-5/+10
| | | | | | | | | | | | | When assigning the lambdas directly to a function_ref their lifetime is limited to that of the expression. Store them on the stack first to avoid the UB. Fixes: QTBUG-104419 Pick-to: 6.4 Change-Id: I3c85ac683b0bd7768b646dc9d0a1ed4dd173e6f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Endian: Remove old special integer bitfieldsUlf Hermann2022-06-161-29/+0
| | | | | | | | | | | | | | The only way to use them was to put them in a union and then write all the members of the union to set the various bit ranges. As only one member of a union can be active at any time, the compiler is free to optimize those writes away, though. This has started happening in the wild now. As we have a replacement, we can remove the old and broken code now. Task-number: QTBUG-99545 Change-Id: I90718ec06662258d1c15220f54da9eed2186c5a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "qxp::function_ref: drop use of q23::invoke_r"Marc Mutz2022-06-141-0/+40
| | | | | | | | | | | | | | | | | | | | This reverts commit b9cce12e76796962e5e5ad0d5408370af56af459, which broke function_ref<void(int)> f = [](int i) { return i; }; ie. swallowing of return types. We could maybe implement the same without invoke_r, with the same manual if-constexpr that invoke_r has, but it would be a pointless duplication across the two thunks we have, so just use invoke_r. Add tests. Pick-to: 6.4 Task-number: QTBUG-103739 Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Endian: Allow special bitfield union fields to cover the whole storageUlf Hermann2022-06-021-1/+11
| | | | | | | | This requires a different computation of the mask since we can't shift out of the storage type. Change-Id: Ife85ca3e0c5ca47f06988a397cc2f8a7e28ad0fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Short live qxp::function_ref!Marc Mutz2022-06-024-0/+243
| | | | | | | | | | | | | | | This is an implementation of function_ref, which has been proposed for inclusion into C++23, but has not been accepted, yet, which is why we place it in namespace qxp (for eXPerimental) instead of q23. The implementation is based on wg21.link/P0792r9, which, at the time of writing, is the latest revision of the paper. It will be used in both QTestLib and qmldom. Fixes: QTBUG-103739 Change-Id: I52723eca28f7ac02ce7ce51928361d81ae5c92b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qglobal.h: use the GCC attribute for nothrow in C modeThiago Macieira2022-05-271-1/+2
| | | | | | | There's exactly one use in Qt: the qVersion() function. Change-Id: Ieb9a2aa1ea914b1b956bfffd16eff4b3b9e2119a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qglobal.h: #include <stdbool.h> in C modeThiago Macieira2022-05-181-9/+0
| | | | | | | It's C99 and we require C11. Change-Id: Ieb9a2aa1ea914b1b956bfffd16eff4556b99f976 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1619-538/+52
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-111-6/+0
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Endian: Provide special integer bitfield unionsUlf Hermann2022-05-071-1/+105
| | | | | | | | | | | | | | | | | Our previous approach of creating a union from individual special integer bitfields leads to undefined values because only one member of a union can be active at any given time. Compilers have finally caught up with us on that and have started removing "no-op" writes to members. The primary user of the special integer bitfield unions is qv4compileddata_p.h in qtdeclarative. We want our on-disk format of QML compilation units to be platform agnostic and space efficient. Pick-to: 5.15 6.2 6.3 Task-number: QTBUG-99545 Change-Id: I24847bda2c364eb8ba75f074cde2a9bec25ced06 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move some purely floating-point testing from tst_QLocale to tst_QNumericEdward Welbourne2022-04-011-0/+13
| | | | | | | | | The testing of infinity and NaN somewhat duplicated existing tests in tst_QNumeric and, in any case, belongs there. Change-Id: I6b5d1ff9767daf8e4bbe0025d3efab3d74ed35de Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use constants of the correct type in qnumeric NaN testEdward Welbourne2022-04-011-11/+12
| | | | | | | | | Replaces 0, 0.0, 1, 1.0 and 2.0 with zero, one and two constants of the templated floating-point type, to avoid type-conversions which might have meant the test only checked doubles, or similar. Change-Id: Id9d4488f0cc7226b5b8958d2a204a76fe5ae469d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Tests: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+2
| | | | | Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix has_signaling_NaN usage for INTEGRITYTatiana Borisova2022-03-161-2/+5
| | | | | | | | | | - The newest GHS compiler versions set the value of has_signaling_NaN to False. Add compilation and autotest fix for GHS-compiler 2021/2022 releases. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I45e5da6759a15c60c17f896e565002cbba8524ed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore C++20-deprecated mixed-enum bitwise operatorsMarc Mutz2022-03-151-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 deprecated arithmetic on enum types. For enums used on QFlags<>, these operators have always been user-defined, but when the two enums are of different type, such as QFrame::Shape and QFrame::Shadow, the deprecation warning pops up. We have in the past fixed these in our headers by manual casts, but that doesn't help our users when our API requires them to OR together enums of different type. Until we can rework these APIs to use a variadic QFlags type, we need to fix it in an SC and BC way, which is what this patch sets out to do. The idea is simply to mark pairs of enums that are designed to be ORed together and replace the deprecated built-in bitwise operators with user-defined ones in C++20. To ensure SC and BC, we pass an explicit result type and use that to check, in C++17 builds, that it matches the decltype of the result of the built-in operator. This patch is the first in a series of similar patches. It introduces said markup macro and applies it to all enum pairs that create warnings on (my) Linux GCC 11.3 and Clang 10.0.0 builds. It is expected that more such markups are needed, for other modules, and for symmetry. Even with this patch, there is one mixed-enum warning left, in qxcbwindow.cpp. This appears to be a genuine bug (cf. QTBUG-101306), so this patch doesn't mark the enums involved in it as designed to be used together. This patch also unearthed that QT_TYPESAFE_FLAGS, possibly unsurprisingly so, breaks several mixed bitwise flags-enum operations (QTBUG-101344). Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-99948 Change-Id: I86ec11c1e4d31dfa81e2c3aad031b2aa113503eb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_qflags: test w/and w/o QT_TYPESAFE_FLAGSMarc Mutz2022-03-082-14/+31
| | | | | | | | | | | | Also contains some fixes which fix the Windows build, amending e1b8257deeff67025d75b4b3c27b571b418eefee. Pick-to: 6.3 Fixes: QTBUG-101294 Fixes: QTBUG-101304 Change-Id: I779f50fc705ed32f0314daf28b39b477a7fe925d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qtestmouse.h: compile with QT_TYPESAFE_FLAGSMarc Mutz2022-03-071-0/+44
| | | | | | | | | | | | Also include the comprehensive tests for bool cast compilation which I originally wrote to confirm that the QTEST_ASSERT() change should be™ correct. Pick-to: 6.3 Task-number: QTBUG-101406 Change-Id: I9a2871bfd4be9999b7a720bec775bba7aeffbe24 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tst_qflags: don't suppress deprecation warningsMarc Mutz2022-03-031-1/+0
| | | | | | | | | | ... if there aren't any. Pick-to: 6.3 Change-Id: I8531e0c1c3ca41d1b1a9d55c9d11782bd63b6f76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qflags: compile with QT_TYPESAFE_FLAGSMarc Mutz2022-02-281-3/+10
| | | | | | | | | | | | | In constExpr(), where code incorrectly assumed conversions to int or uint were implicit, make them explicit. In classEnum(), don't test bitwise operators between QFlags and int/uint when QT_TYPESAFE_FLAGS is in effect. Pick-to: 6.3 Fixes: QTBUG-101294 Change-Id: If119bf56dd12778f7231a9e76293c76e75354809 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: fix missing bitwise xor operators in QT_TYPESAFE_FLAGS buildsMarc Mutz2022-02-281-0/+23
| | | | | | | | | Add tests that cover them. Pick-to: 6.3 Fixes: QTBUG-101300 Change-Id: I5a8af4a91d796cc4d287b813bd5cc13da3d7e766 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qlogging (tst_qmessagehandler): use one line for output and expectedThiago Macieira2022-02-201-3/+4
| | | | | | | | | Makes it easier to interpret the output from the test, because of embedded newlines. Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d4f141e09537f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qlogging (tst_qmessagehandler): use QProcessEnvironmentThiago Macieira2022-02-201-22/+12
| | | | | | | | | Simplifies the code. And removes the unnecessary quote around the pattern that was there, for some reason. Pick-to: 6.3 Change-Id: Ic15405335d804bdea761fffd16d4f135edf6993b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qmessagehandler: force QProcess tests to log to stderrPasi Petäjäjärvi2022-02-171-0/+1
| | | | | | | | | These tests rely on reading output sent to stderr, so make sure their output does go there. Pick-to: 6.2 6.3 Change-Id: If62c073101c1d2e3d64f8cb2769d67f3b9fbeefb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Exclude denormal test cases if system doesn't support itTatiana Borisova2022-02-151-0/+5
| | | | | | | | | | | | - current INTEGRITY development pack don't support denormals for float and double. All values are rounded to 0. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: Iaaacdc4210c7ac2ec3ec337c61164a1ade0efb01 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_qlogging: use correct qlogging_helper path on webOSJanne Juntunen2022-02-031-11/+17
| | | | | | | | | | | Switched to use runtime path instead of compile time path for the helper executable. Some tests cases were failing on webOS because of wrong path. Fixes: QTBUG-99846 Pick-to: 6.3 Change-Id: I566bc04bdb96ac6e7dd0a875eadb50685aef8282 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix tst_qfloat16 run time error for INTEGRITY (tested on sa8115)Tatiana Borisova2022-01-301-0/+5
| | | | | | | | | | | - Bounds::has_denorm returns denorm_indeterminate. It is expected behavior for GHS compiler. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I8402c541093a73623b6dc507012d98e565789cff Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_qglobalstatic is halted on INTEGRITY deviceTatiana Borisova2021-12-201-0/+6
| | | | | | | | | | | - Stress test creates too many threads on run time. Testing system is limited in 123. Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: I215074fa432c8aa18b2a753169646841c01d0b2a Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rewrite Q_{GLOBAL,APPLICATION}_STATIC with C++17 goodiesThiago Macieira2021-12-121-1/+1
| | | | | | | | | | | | Especially static inline variables. This greatly reduces the amount of code that existed in macros, moving them to templates. Additionally, this removes one level of indirection from Q_APPLICATION_STATIC by removing the std::unique_ptr. We now directly manage the object's storage. Change-Id: I2cffe62afda945079b63fffd16bcc825cc04334e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QNX: Remove expected failPasi Petäjäjärvi2021-12-121-3/+0
| | | | | | | | Works with QCC 8.3.0 (Based GCC 8.3.0 20190222 (stable)) Pick-to: 6.2 Change-Id: I130847627a4b77ced83d196a7a1674963c5cd3e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_qfloat16 runtime failure for INTEGRITYTatiana Borisova2021-12-061-0/+13
| | | | | | | | | | - GHS compiler is not fully compliant with iec559. Therefore we need to update is_iec559 checking for GHS case. Pick-to: 6.2 Change-Id: Ia094509d26bf5f0109f2937547a056267019cffb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Do not include qloggingcategory.h in public headersKai Köhne2021-11-162-0/+3
| | | | | | | | | | | | | | | Reduce overhead for including qguiapplication.h by splitting up qnativeinterface.h into a public and a private part. [ChangeLog][Potentially Source-Incompatible Changes] The qguiapplication.h header no longer implicitly includes qloggingcategory.h. If your code depends on the transitive include, explicitly include <QLoggingCategory> where needed. Pick-to: 6.2 Task-number: QTBUG-97601 Change-Id: Ic02327a1c3092e21730160af5c59a9d58dc1239c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Teach QOperatingSystemVersion to handle new OS entries in patch releasesMårten Nordheim2021-11-121-0/+11
| | | | | | | | | | | | | | Adding new entries to QOperatingSystemVersion in patch releases was previously breaking our BC guarantees because the entries are exported, thus users cannot freely switch between different patch-releases without a recompile if they adopted the new entries. Move the data itself to a base class so that the entries can be constructed inline. Task-number: QTBUG-97808 Change-Id: Ic44f07488af8a04a3bedc10bebb740c4d68f43f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-11/+0
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove checks for features available in C++17Ievgenii Meshcheriakov2021-10-021-3/+0
| | | | | | | | | | This patch removes most of the checks that are made using C++20 __cpp_* macros for features available in C++17 and earlier. Library feature check macros (__cpp_lib_*) are unaffected. Change-Id: I557b2bd0d4ff09b13837555e9880eb28e0355f64 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Compile autotests for IntegrityTatiana Borisova2021-09-202-5/+8
| | | | | | | | | - process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tests: Remove unused SRCDIR definesIevgenii Meshcheriakov2021-08-171-2/+0
| | | | | | | | | | | Remove SRCDIR defines from tests that don't use them. There is a standard define called QT_TESTCASE_SOURCEDIR that is available to all tests and serves the same purpose. Pick-to: 6.2 Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix various -Wdeprecated-enum-float-conversions around the codeMarc Mutz2021-07-271-10/+8
| | | | | | | | | | | In two cases, it was as easy as replacing an unnamed enum's values with constexpr variables. In the case of QSimplex, I opted for qToUnderlying(), as the enum made sense on its own. Change-Id: Ifcf5be14bd2f35e50adabdbd7ecdb2e83f6bf5b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use member function instead of template function to resolve native interfaceTor Arne Vestbø2021-07-171-8/+10
| | | | | | | | | | | | | | The use of a freestanding function is not needed now that the name doesn't alias the nativeInterface accessor function, and was just adding complexity to the machinery. People not familiar with the code will have an easier time following the flow through the helper member function, and we no longer need to declare our own export macros. Pick-to: 6.2 Change-Id: I17530b7e89939cfc19ab8ffaa076b7129ae02dcf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve error reporting when requesting unsupported native interfaceTor Arne Vestbø2021-07-151-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By switching out the static_assert for an enable_if we end up producing a clearer error, at the call site: /qt/qtbase/examples/gui/rasterwindow/main.cpp:69:9: error: no matching member function for call to 'nativeInterface' app.nativeInterface<QNativeInterface::QCocoaGLContext>(); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /qt/qtbase/src/gui/kernel/qguiapplication.h:176:5: note: candidate template ignored: requirement 'NativeInterface<QNativeInterface::QCocoaGLContext>::isCompatibleWith<QGuiApplication>' was not satisfied [with NativeInterface = QNativeInterface::QCocoaGLContext, TypeInfo = QNativeInterface::Private::NativeInterface<QNativeInterface::QCocoaGLContext>, BaseType = QGuiApplication] QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication) ^ By using SFINAE for the TypeInfo we can also ensure that it works for types that are not native interfaces, such as if the user tries to call nativeInterface<QString>(). Since we can no longer use decltype(*this) to resolve the base type we need to change QT_DECLARE_NATIVE_INTERFACE_ACCESSOR to take the type as an argument, as we do for other QT_DECLARE_FOO macros. Pick-to: 6.2 Change-Id: Ie3f7e01ab7c3eb3dcc2ef730834f268bb9e81e0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add test for native interface machineryTor Arne Vestbø2021-07-153-0/+129
| | | | | | Pick-to: 6.2 Change-Id: I76acd54039dcc7c662ca7a6e859f21d75dcf4dc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix tst_qmessagehandler::formatLogMessage() test on AndroidAssam Boudjelthia2021-07-011-0/+4
| | | | | | | | | This amends 87d8ee755bfdef8e72a122789c2e3ed382881a12. Pick-to: 6.2 Task-number: QTBUG-94708 Change-Id: Iac9b0f896ede76074504f777b65ad572dd8d6377 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* tst_qglobal: fix an uninit'ed variable warningMarc Mutz2021-06-301-1/+1
| | | | | | | | | | GCC can't see through all the foreach code to determine whether the loop will execute at least once, so don't play hardballs with the compiler and initialize the variable. Change-Id: I95756a99eda497a25aa277046df9895f558758c3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Prefer QFAIL("Informative message") over QVERIFY(false)Edward Welbourne2021-06-141-5/+5
| | | | | Change-Id: I706b0aedfa870452331a8c2c488d55b279ee452a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Suppress gcc warning -Wmemset-elt-size on test codeEdward Welbourne2021-06-141-1/+5
| | | | | | | | | | | | | The test uses a 64-unit array and deliberately clears various portions of it, provoking a gcc warning: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] The calls to memset() do, in fact, have a sizeof(T) factor in their size. Suppress this warning for the duration of that test. Change-Id: I7d144d655a75f5ef4449fa3b956f80bcc509a83b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live qToUnderlyingGiuseppe D'Angelo2021-05-181-0/+20
| | | | | | | | | | | "Cherry-pick" of C++2b's std::to_underlying. [ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been added, to convert an value of enumeration type to its underlying value. Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>