summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* QApplication: send QHoverEvents with correct scenePosition()Shawn Rutledge2022-10-231-0/+101
| | | | | | | | | | | | | | | | The QHoverEvent ctor takes two points: pos and globalPos; pos is then passed as both the scene and global pos to the QSinglePointEvent ctor, which calls QMutableEventPoint::setScenePosition() on the persistent QEventPoint instance and then detaches befeore setting ephemeral state. Therefore, we must construct QHoverEvent with scene position first, not local position, so that the right value is persisted; it's better to set local position after the detach(), whereas it's too late to fix the persistent point then. Pick-to: 6.4 Fixes: QTBUG-106918 Change-Id: I45726a9ec05bba2fe0cde6f5fb87c269105caca6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix bool comparison in tst_qopenglwidget.cppPeter Varga2022-10-231-3/+3
| | | | | | | | This commit amends 1ea73bc29b7542141bfcfa138cc194404c283bd5 Pick-to: 6.2 6.3 6.4 Change-Id: I02000f86ff030ad369ccef1d4488ad22558eb974 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Set alphaBufferSize to -1 when disabling translucency in QtWidgetsPeter Varga2022-10-211-0/+26
| | | | | | | | | | | -1 is the default value for QSurfaceFormat::alphaBufferSize. Changing it to 0 may result an unexpected pixel format change by ARB OpenGL extension. Pick-to: 6.4 Fixes: QTBUG-107629 Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* dbus: use same type of matching quotesMaxime Roussin-Bélanger2022-10-212-10/+10
| | | | | | | | There is no reason to use different style of quotes when printing messages. Change-Id: I7d513ec04c803702974054569d28f26947942fbf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: fix Android assets handler not listing dirs with only sub dirsAssam Boudjelthia2022-10-214-0/+26
| | | | | | | | | | | | | | | | | | Amends edd983071e0a90ee8665d2f45916fb575fc25857. Remove redundant calls to AAssetDir_getNextFileName() in AndroidAbstractFileEngine::setFileName(). It's enough to check if AAssetManager_open() returns null and AAssetManager_openDir() is valid for the provided asset file name. As part of this fix, add some unit tests to cover/ensure assets listing/iterating works as expected. Fixes: QTBUG-107627 Pick-to: 6.4 6.2 5.15 Change-Id: I37ae9cb64fbbc60699bb748895f77fd6a34fae1f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tests: skip tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() on WaylandLiang Qi2022-10-211-0/+3
| | | | | | | | | | | QWindow::requestActivate() is not supported. This function crashed very often in ci/coin when system is busy. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: I82523080db40bddce9c9dc000433117d8ef74847 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: skip tst_QGraphicsProxyWidget::scrollUpdate() on WaylandLiang Qi2022-10-211-0/+3
| | | | | | | | | | | QWindow::requestActivate() is not supported. This function failed in test vm in coin manually very often. Task-number: QTBUG-107153 Pick-to: 6.4 6.2 Change-Id: I013651b0e5e7618c29742effd85a091ca95a7414 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QWinRegistryKey: fix assert when querying default valueYuhang Zhao2022-10-211-1/+17
| | | | | | | | | | | | | | | | | I wrongly assumed we can't query a value with an empty name "" during the previous refactor commit, however, in Windows registry, an empty name for a value means the default value of a key, we can read and write it through the "Default" name. Remove the wrong assert to fix the crash when we are trying to query a default value of a key. Add a new test case to test this kind of scenarios. Amends commit 40523b68c14bf618bdc2d5438deebf34627be3af Fixes: QTBUG-107794 Change-Id: Idacbcb86df4435a8c1ca1c19121599390ae8f3d3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QLibrary: fix loading multiple versions of a libraryThiago Macieira2022-10-201-0/+66
| | | | | | | | | | | | | | | | | The libraryMap only stored the file path, so we couldn't load two versions of the same library as we'd find the other version already loaded. Change the map to index by file name and version (using a NUL as separator, since that can't appear in file names). [ChangeLog][QtCore][QLibrary] Fixed a bug that caused QLibrary to be unable to load two different versions of a library of a given name at the same time. Note that this is often inadviseable and loading the second library may cause a crash. Pick-to: 6.4 Change-Id: I12a088d1ae424825abd3fffd171ce3bb0590978d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Android: skip tessellation(Vulkan)Assam Boudjelthia2022-10-201-0/+2
| | | | | | | | | Fails on CI's Android 12 emulator. Amends c681c7c23f79e2f0d6dbb2ce8961edd216cefd91. Change-Id: Icb0c39a9d0b7952aea76b7b0c45fbfc7f2b0556f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix typo in QWasmWindowStack's nameMikolaj Boc2022-10-201-11/+11
| | | | | | | 'Wasm' in it is duplicated. Change-Id: Ie00e02fb7ae4d9e13f490ce2d46a4eabf3f5710c Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* tst_QTcpServer: Unblacklist addressReusableMårten Nordheim2022-10-201-4/+0
| | | | | | | | | | | According to the grafana dashboard it has not failed in the past week. Reverts ad736e9150af6ac621393529a72c8e67e05c2d5e Pick-to: 6.4 6.2 Change-Id: I3eac3c7fd667cfe2cf951b2808dddbfed8eae087 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Apply Q_FLAG to flag type instead of enum typeFabian Kosmale2022-10-191-1/+2
| | | | | Change-Id: I05cebef521a532654ae8fa306eed9c8db5a0db69 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLibrary: fix load() after a failed load()Thiago Macieira2022-10-181-0/+74
| | | | | | | | | | | Regression introduced by commit 8d4eb292b2e8fc14437db97febdc2eebe36ed3ce in 6.0, when QTaggedPointer was introduced. We set the tag even when the loading failed and failed to reset it because d = {} retains the tag. Pick-to: 6.2 6.4 Fixes: QTBUG-103387 Change-Id: Ie4bb662dcb274440ab8bfffd170a07aa9c9ecfca Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QLibrary: add a cleanup() method to unload left-oversThiago Macieira2022-10-191-0/+33
| | | | | | | | | | | | | | | QLibrary intentionally does not unload on destruction, so failing tests may leave libraries already loaded and cause further tests to fail because of that. So add a cleanup() method to unload everything we may have loaded. Note that QLibrary::unload() sets its state to NotLoaded after one successful call, so we must recreate the object in case it had been load()ed multiple times. Pick-to: 6.2 6.4 Change-Id: I12a088d1ae424825abd3fffd171d133c678f910a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QSet: fix flakiness after we removed the fixed, non-zero seedThiago Macieira2022-10-181-11/+21
| | | | | | | | | | | | | | The "qhash" test relied on the fact that those four elements would produce a different order with a zero and a non-zero seed. But since commit b057e32dc455d81f9378d6bd0c58888a7eddd155 removed the setting of a deterministic non-zero seed, this test had a 1 in 4! chance of failing. Since 4! = 24, 128 retries should be more than enough to ensure we do find at least hash seed that provokes a different order. Fixes: QTBUG-107725 Change-Id: I3c79b7e08fa346988dfefffd171ee61b79ca5489 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tst_QSql*/sqlite: Don't use random output in the datatagsMårten Nordheim2022-10-181-1/+9
| | | | | | | | | | | | | It makes it impossible to rerun it, bad for both CI and local test runs. As a drive-by name the database file sqlite.db instead of foo.db Pick-to: 6.2 6.4 Fixes: QTBUG-100245 Change-Id: I2e4ee01189ccbad2a6add5db7771d35fd7248da8 Reviewed-by: Dimitrios Apostolou <jimis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Anticipate various warnings in tst_QVariantEdward Welbourne2022-10-181-18/+40
| | | | | | | | | Various places were knowingly provoking warnings without telling QTest to check for and suppress those warnings. Some others did check for this warning, so let's consistently suppress the noise. Change-Id: I71b9829680c7a513f4d8fbb3c57442875a6c2dc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Ignore the warning for all types in tst_QCborValue's mapFromArray*()Edward Welbourne2022-10-181-6/+1
| | | | | | | | | For some reason the QTest::ignoreMessage() was conditioned on the type being tested being Array; however, the warning is in fact produced for all types. So anticipate it for all and make the test log less noisy. Change-Id: I78681624252ff8a71f080204f8b031609ddac468 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QChar::fromUcs4(): deduplicate a test-caseEdward Welbourne2022-10-181-3/+3
| | | | | | | | | There were two copies of the 0x1D157 row and we can't remember why. So change one of them to the Chakma digit 3 (a spiral) and annote all three test-cses with what meaning Unicode assigns to them. Change-Id: I95837588bd5944f7f2c39c8438d9076e844e4dd0 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QLocalSocket::listen(): distinguish two data tagsEdward Welbourne2022-10-181-2/+2
| | | | | | | | Two test-cases had the same name; distinguish them by the part of their data in which they differ - one closes, the other doesn't. Change-Id: I37051baf194bf8df742688739ad01e3335e64dc7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QDoubleValidator::setRangeOverloads(): rename a data rowEdward Welbourne2022-10-181-1/+1
| | | | | | | | | | | Two rows shared the same name. They claimed the value used was out of range, but actually that was only true for one of them. The other was in range, but the test reduced the number of digits allowed after the decimal point, thereby making it invalid, so rename that one to reflect this. Change-Id: I0936ea25ec799c0069cd148b9f9bae5d35906093 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tst_QFont::serialize(): distinguish two letterspacing data tagsEdward Welbourne2022-10-181-2/+2
| | | | | | | Include the spacings used, to avoid a naming collision. Change-Id: Iaf78f7142f6780dcf4c7a0b973db9f625af06767 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_QPainter::blendARGBonRGB(): rename some data rowsEdward Welbourne2022-10-181-8/+8
| | | | | | | Avoid duplication by distinguishing similar test-cases. Change-Id: I1a100d6c9729f0ea356f177535d15c3d36e2da9e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QPainterPath::testNaNandInfinites(): anticipate the warningsEdward Welbourne2022-10-181-3/+30
| | | | | | | | | | | | The test used to trigger a lot of QWARN messages; these are clearly intended, so tell QTest to expect them, so that we get an error here if those warnings ever don't show up. Incidentally tidy up a comment and convert a != verify to a QCOMPARE_NE(), since it's now available to do that job. Change-Id: I83e225c37abe8446dac06ebe4e75258cb87b71b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QPainterPath::testArcMoveTo(): include index in some data tagsEdward Welbourne2022-10-181-8/+8
| | | | | | | | | | | | In the process, clean up the building of the data tags: use a range-for loop, albeit we do need an index to show in tags; show it and the angle in the tags using addRow()'s easier formatting. Change the low angle tests to show the sign of the angle (which is how they differ)rather than just labeling them 1 and 2. Change-Id: Ib5aaa3e22d771c530c9343ba368b0fdfceb264ce Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* tst_QPainterPath::contains_QRectF(): rename some data rowsEdward Welbourne2022-10-181-3/+3
| | | | | | | | | | The last three duplicated earlier ones; and their names didn't take into account the circle that had been added to the path since those tests. So revise their names to reflect that. Change-Id: I32d74f21947b4ba0c04eee53daf8efde6b4a6409 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tst_QImage::reinterpretAsFormat(): deduplicate a data tagEdward Welbourne2022-10-181-1/+1
| | | | | | | | Two rows shared a data tag. Prefixed one of them with the color of the half-transparent image it involves (the other's is fully transparent). Change-Id: I1bd174008ed29bcf2f460e683fdf6d1f12ba19d0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QImage::mirrored(): deduplicate some data row namesEdward Welbourne2022-10-181-6/+6
| | | | | Change-Id: Ia10c72c450eed12d29c9608c6a6270dd4dc4ef7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QImageReader::preserveTexts(): deduplicate data tagsEdward Welbourne2022-10-181-11/+23
| | | | | | | | | The same data tags were used with two distinct filenames in their data. Include the basename of each filename in the data tag, to avoid duplication. Change-Id: I216fecbd413fab409227ad6f93f8ac3fcc74b059 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* tst_QKeySequence::parseString_data(): drop duplicated rowsEdward Welbourne2022-10-181-4/+0
| | | | | | | | The "a" and "A" rows appeared under Valid, then again under Only Keys. The two copies were identical, in each case, so drop the latter. Change-Id: Ib3d84710e772171bb4a5e0aefd20022810fb41cd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_QDBusTypes::isValidFixedType: don't duplicate fixed typesEdward Welbourne2022-10-181-1/+0
| | | | | | | | | tst_QDBusType::isValidFixedType_data() called addFixedTypes() and then addBasicTypes(); but the latter calls addFixedTypes(), too; so those rows got duplicated. Only add the fixed types once. Change-Id: If0d6f44ec7defb12117dad251878850ca75beb48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QRect::containsPointF_data(): remove duplicate data rowEdward Welbourne2022-10-181-2/+0
| | | | | | | | | | | The row 27 that was positioned before row 01, as if it were meant to be numbered row 00, was identical to the row 27 that appeared after row 26. Since row 26 was the other case dealing with the null QRectF(), I kept the one after it instead of renumbering row 00 and deleting row 27. Change-Id: I3585839184233f1f1629280ac9e5b25110c155c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QCryptographicHash: avoid duplicate data tagsEdward Welbourne2022-10-181-1/+1
| | | | | | | | | Use key(i) rather than valueToKey(value) as the Sha3_* alias Kekkak_* or RealSha3_*. This way, we still test all members of the enum, without duplicating row keys (albeit the aliases duplicate values). Change-Id: I6acba5ffdf5b68294031d609a76b37ca8fad9d94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QBitArray: remove duplicate data rowsEdward Welbourne2022-10-181-2/+0
| | | | | | | | Both countBits() and datastream() had two copies of an all-zeros test with 35 zeros. Removed the second, in each case. Change-Id: I5dec4765236ae870c30828dae0f04b8902a100f0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MSVC: Disable buggy conformance checkYuhang Zhao2022-10-181-1/+1
| | | | | | | | | | | | | | | /Zc:lambda seems buggy. Although in my experiments it works well for 99% Qt repos, it seems some tests will trigger the bug and it also blocks some new commits. So disable it for now, it's not stable enough. Now that this check is disabled, the workaround for tst_qstringapisymmetry is also not needed anymore, so remove the workaround as well. Partially reverts commit 8cb832090a8a0e7226904561f97c6de954d752ed Change-Id: Icf0ecbbaa6262522470e5f5dea05705985ab18f1 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix flakiness in tst_QDoubleSpinBox / editingFinishedAxel Spoerl2022-10-181-1/+8
| | | | | | | | | | | | | | | setFocus() was called on a double spinbox without calling show() first. That causes flakiness on XCB when checking focus afterwards. The test can still fail, when focus is acquired by e.g. a system popup. This patch adds a show() call before setFocus() to stabilize normal behavior. In case the double spin box is shown, but cannot acquire focus, the test is skipped. Fixes: QTBUG-70088 Change-Id: If02e88800a31b09a1da63dcc074eb8bb1b0df391 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Port qCompress() to zstream/deflate()Marc Mutz2022-10-171-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zlib convenience API we've been using so far has two problems: - On Windows-64, where sizeof(long) == 4, the use of ulong for sizes meant that we could not compress data compressable on other 64-bit platforms (Unix). While zstream also uses ulong, being a stream API, it allows feeding data in chunks. The total_in and total_out members are only required for gzip compression and are otherwise just informational. They're unsigned, so their overflow does not cause UB. In summary, using zstream + deflate() allows us to compress more than 4GiB of data even on Windows-64. - On all platforms, we always allocated the output buffer in such a way as to accommodate the pathological case of random, incompressible data, so the output buffer was larger than the input. Using zstream + deflate(), we can start with a smaller buffer, then let zlib pick up where it left off when it ran out of output buffer space, saving memory in the common case that compression meaningfully reduces the size. To avoid the first few rounds of reallocations, we continue to use zlib's compressBound() for input less than 256KiB. This completely fixes the compression side of QTBUG-106542 and QTBUG-104972. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-104972 Fixes: QTBUG-106542 Change-Id: Ia7e6c38403906b35462480fd611b482f05a5c59c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_Q{BitArray,ContiguousCache}: check not only count(), but size(), tooMarc Mutz2022-10-172-0/+3
| | | | | | | | Add at least a few, so size() isn't completely untested. Pick-to: 6.4 6.2 5.15 Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QAlgorithms: fix misleading indent in data tableEdward Welbourne2022-10-171-8/+11
| | | | | | | | | | A violation of coding style (requiring braces on multi-line bodies of conditionals) was accompanied by a mis-indented else block. Fix a long line while I'm about it. Change-Id: Ibe9cf15eadbe9ef58138d7876e5e2c5a14a92fd4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Clean up tst_QAlgorithms::count{Trail,Lead}ing_data_impl()Edward Welbourne2022-10-171-12/+15
| | | | | | | | | | | | | | | Pull out the arbitrary factor of three as a named constant and document its arbitrariness once. Pull out the mask and bit used in each function's loop to the outer layer of the loop, since they don't depend on the inner loop variable (or the random value generated in that loop). Use QTest::addRow() instead of constructing a string to pass to newRow(). Change-Id: Ifacbcb390e00828fd47f51b0c73d0ad5f6bc8bdb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QTime: fix two duplicated test data tagsEdward Welbourne2022-10-171-2/+2
| | | | | | | Names for data rows should be distinct. Change-Id: I2ee1c4f362222d448278a90fc0a1cc9731e30976 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QDateTime: eliminate some duplicate test-casesEdward Welbourne2022-10-171-9/+0
| | | | | Change-Id: I588494f2a79340599cafc48b3f4f4a79e6ca0a19 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QAtomicInt:fetchAndAdd(): remove two duplicate data rowsEdward Welbourne2022-10-171-2/+0
| | | | | | | Change-Id: I6568399945f421a18ddb5c52c68f82474de936c5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QStringApiSymmetry: use startpos to deduplicate indexing data tagsEdward Welbourne2022-10-171-11/+15
| | | | | | | | | The tests for indexOf() and lastIndexOf() had duplicate data row tags, due to only using the needle and haystack, although some tests differed only in start position. Include start position where needed. Change-Id: I197d415265ab1a805f2d36fb88aec92ea8646f7a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QStringApiSymmetry: avoid repetition in trimmed_data()Edward Welbourne2022-10-171-8/+10
| | | | | | | | | | Enclosing one string in each substring of another does not need to repeat the empty substring of the latter. Extracting the empty substring from different positions doesn't get different results. In the process, tidy up the code a bit. Change-Id: Ic66febbdadeaac0c466f4f1174d831a991d31e20 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QStringApiSymmetry: eliminate one duplicate of a mid_data() rowEdward Welbourne2022-10-171-1/+0
| | | | | | | | There were two copies of the same line in mid_data(), leading to duplicated data row tags. Change-Id: Ia21e855ff781b13fe18c932cff48cb0aabd12750 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update Catch2 to v2.13.10Marc Mutz2022-10-172-12/+18
| | | | | | | | | | | Two patches applied to upstream release. Pick-to: 6.4 6.2 Fixes: QTBUG-103321 Task-number: QTBUG-99122 Change-Id: Ief451a21e5f61851cb03a9ca94ffe0f864e4b1f8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port qUncompress() to zstream/inflate()Marc Mutz2022-10-161-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zlib convenience API we've been using so far has two problems: - On Windows-64, where sizeof(long) == 4, the use of ulong for sizes meant that we could not uncompress data compressed on other 64-bit platforms (Unix). While zstream also uses ulong, being a stream API, it allows feeding data in chunks. The total_in and total_out members are only required for gzip compression and are otherwise just informational. They're unsigned, so their overflow does not cause UB. In summary, using zstream + inflate() allows us to decompress more than 4GiB of data even on Windows-64. - On all platforms, if the size hint in the header was too short, we'd double the output buffer size and try again, from scratch. Using zstream + inflate(), we still need to reallocate, but we can then let zlib pick up where it left off when it ran out of output buffer space. In all but the most pathological cases, copying the already-decoded data instead of re-decoding it again should be faster, esp. if QArrayData uses realloc() instead of malloc() + free() to grow the buffer. We also now directly allocate at least as much output buffer as we have input, to cut the first few rounds of reallocations when the expectedSize was created, as qCompress still does, using modulo arithmetic mod 4GiB instead of saturation arithmethic. Factor the growing of the output buffer into a wrapper function, flate(), which can be reused when porting qCompress(). This completely fixes the uncompression side of QTBUG-106542 and QTBUG-104972. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Task-number: QTBUG-106542 Change-Id: I97f55ea322c24db1ac48b31c16855bc91708e7e2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>