Results on my machine:
PASS : tst_QReadWriteLock::writeOnly(QMutex)
RESULT : tst_QReadWriteLock::writeOnly():QMutex:
3,607 msecs per iteration (total: 3,607, iterations: 1)
PASS : tst_QReadWriteLock::writeOnly(QReadWriteLock)
RESULT : tst_QReadWriteLock::writeOnly():QReadWriteLock:
39,703 msecs per iteration (total: 39,703, iterations: 1)
PASS : tst_QReadWriteLock::writeOnly(std::mutex)
RESULT : tst_QReadWriteLock::writeOnly():std::mutex:
3,697 msecs per iteration (total: 3,697, iterations: 1)
PASS : tst_QReadWriteLock::writeOnly(std::shared_mutex)
RESULT : tst_QReadWriteLock::writeOnly():std::shared_mutex:
5,727 msecs per iteration (total: 5,727, iterations: 1)
PASS : tst_QReadWriteLock::writeOnly(std::shared_timed_mutex)
RESULT : tst_QReadWriteLock::writeOnly():std::shared_timed_mutex:
5,921 msecs per iteration (total: 5,921, iterations: 1)
(the 'nothing' test of course doesn't work with writing, as writing to
the same QString from different threads is UB)
Change-Id: Ia78b54963a51eaf6563ce0d243316a3337056a83
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
And let the meat of the function be shared with the rbSwap routine.
Change-Id: I0ea18b30c26ff050c17dcb3ad4d654bfbb8c6221
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Test more methods.
Document what the existing test covers.
Use the right #include for QDate.
Change-Id: I051542c244e5bc381aafa3ae38144e246919db7a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Aside from the start-date and the end-date, and a variant with a
time-zone, the lists various tests were building were all built the
same way; so pack that up as a pair of functions (one without
time-zone, one with) to save duplication. Make the list in each
function const, ready for conversion of foreach loops to ranged for.
In the process, replace QList with QVector, reserve space before we
populate and use auto for the now-const list variables it's saved in.
Change-Id: I7d8cce459a4d6111cd645e8d3966ad769ab7e201
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Multiplying a Julian Day number by the number of milliseconds per day
does not get you a time since the start of 1970; it gets you a time
since the start of the Julian Day number system, which was several
millennia earlier.
Change-Id: Ic90a6c3de445baf9cfd30f28dd847f146e6a7adf
Reviewed-by: David Faure <david.faure@kdab.com>
Is pretty common on some architectures so we can avoid swizzling by
supporting it.
Fixes: QTBUG-45671
Change-Id: Ic7a21b5bfb374bf7496fd2b2b1252c2f1ed47705
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The benefit of keeping this code around was to inspire or inform
changes in the areas to take into account possibly missing features
in Qt 5, but at this point that benefit is questionable. We can
always use the history to learn about missing pieces if needed.
Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It couldn't find the test images if not build in sources.
Change-Id: Ieeb5a76694a37d05b3e9a4ed0154885040b0812f
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
- Replace the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Build docs for deprecated APIs conditionally, based on deprecation
version. Remove the docs of methods deprecated since 5.0.0, these
methods are not compiled anymore.
- Modify the tests to make them build when deprecated APIs disabled:
* Make the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods
are enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, add tests for the replacement
Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit re-applies commit f8efe8e0c9,
which was lost in the recent tools → text changes.
Change-Id: I03ce35fcb89840e5607776d67578fb75b66f6eb2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.
Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.
Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
- Replaced the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Modified the tests to make them build when deprecated APIs disabled:
* Made the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods are
enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's not done by toWCharArray. This caused some issues as we were using
API requiring a null-terminator. wcslen for instance was measuring the
string as being millions of characters long, causing fairly quick
crashes when appending.
Change-Id: Iedaaf9f195be22a610543ab649da92a87cb71973
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
RenderHint::HighQualityAntialiasing and NonCosmeticDefaultPen are
obsolete since Qt5 but not marked as such. Therefore add
Q_DECL_ENUMERATOR_DEPRECATED_X now so those two enumerations can be
removed with Qt6.
[ChangeLog][QtGui][QPainter] HighQualityAntialiasing and
NonCosmeticDefaultPen are marked as deprecated and don't have an effect
anymore
Change-Id: Ib0c966a078a1d23d492d0255288e2066c50e87b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
... except where they are actually the component under test.
Java-style iterators are scheduled for deprecation.
Change-Id: If4399f7f74c5ffc0f7e65205e422edfa1d908ee8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".
Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Tidied up the existing float tests in the process.
(In particular, s/SUCCESS/PASS/ since that matches real test output.)
These verify that QCOMPARE() handles floats and doubles as intended.
Extended the existing qFuzzyCompare tests to probe the boundaries of
the ranges of values of both types, in the process.
Revised the toString<double> that qCompare() uses to give enough
precision to actually show some of the differences being tested there
(12 digits, to match what qFuzzyCompare tests, so as to show different
values rather than, e.g. 1e12 for both expected and actual) and to
give consistent results for infinities and NaN (MinGW had eccentric
versions for these, leading to different output from tests, which thus
failed); did the latter also for toString<float> and fixed stray zeros
in MinGW's exponents (which made a kludge in tst_selftest.cpp
redundant, so I removed that, too).
That's further complicated handling of floating-point types, so let's
just keep an eye on how expensive that's getting by adding a benchmark
test for QTest::toString(). Unfortunately, default settings only get
runs that take modest numbers of milliseconds (some as low as 40)
while increasing this with -minumumvalue 100 or more gets the process
killed - and I'm unable to find out who's doing the killing (it's not
QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell).
So results are rather noisy; the integral tests exhibit speed-ups by
factors up to 5, and slow-downs by factors up to 100, between runs
with and without this change, which does not affec the integral tests.
The relatively modest slow-downs and speed-ups in the floating point
tests thus seem likely to be happenstance rather than signal.
Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QFile/QFileInfo::readLink() functions are obsolete but were not marked
as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.
Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This makes it possible to get rid of specialized functions for
converting to RGBA64PM, while at the same time making the conversion
faster as the painter routines are better optimized.
Change-Id: I3e73856b2c1411977450e72af1741aab0ecf537e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
That's an undocumented Qt 4/3/2 remnant, start remove usages.
Fix incorrect include header in qclass_lib_map.h as a drive-by.
Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.
Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Move the creation of the symbolic link/junction from the _data() slot
into the actual test function. The parameters are passed by a newly
introduced struct. This ensures only the symbolic links/junctions that
are actually needed are created. It can then no longer happen that
filtering for one data row invokes recursive deletion of the mountpoint
junction.
Also use of the newly introduced convenience createSymbolicLink()
in canonicalFilePath()
Task-number: QTBUG-63989
Change-Id: Ia78fd4ad6097136934ab5a375f4c352713d0f115
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Using std::vector saves a bit c++ code when using range-for loop over
the vector.
Besides, no shared copies created anymore which is a bit faster.
Change-Id: I564306ed9ac907e9f32f59b33ed15c027a59b4eb
Reviewed-by: David Faure <david.faure@kdab.com>
Instead iterating through all rows to get the number of hidden items,
iterate over the hidden items which are fewer items.
Also don't create a temporary vector with visible flow positions by
remembering the count of hidden items before the working index and
adjusting them appropriately which gives a significant performance
boost when working with a large data set.
[ChangeLog][QtWidgets][QListWidget] Speedup handling of hidden items
when working with large data sets
Task-number: QTBUG-68977
Change-Id: I599b6e97945c245f02229145baad8363ec2bf2f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Adds support for 16bit per color image formats in QImage. This makes it
possible to read and write 16bpc PNGs, and take full advantage of the
16bpc paint engine.
[ChangeLog][QtGui][QImage] QImage now supports 64bit image formats with
16 bits per color channel, compatible with 16bpc PNG or RGBA16 OpenGL
formats.
Task-number: QTBUG-45858
Change-Id: Icd28bd5868a6efcf65cb5bd56031d42941e04099
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Creating and sorting a list of bytearrays just to check if one entry is
present, is really overkill. By adding a new virtual method
isTimeZoneIdAvailable() in the backend classes, we can do this much more
efficiently.
Implemented for Utc and Tz backends, the others fall back to the
slow way.
The new benchmark shows, in release mode:
Before: 43 msecs per iteration (total: 86, iterations: 2)
After: 1.1 msecs per iteration (total: 73, iterations: 64)
Change-Id: Ic0d79a41d74e2ce6aa088fa7986c41d33902c36b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are too many combinations and the data is not very useful when
it is impossible to get an overview. This cuts a few rare formats out
and reduces the sizes tested to one small for overhead benchmarking
and one large for bandwidth benchmarking.
Change-Id: If0fe33e0e02b8cba771094a79072036f2cd4cf48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Uses the scripts and tests we already have for lancelot as a painting
benchmark.
Change-Id: Idf8a55e2261162e619f6dbb567dc19f8dc96da4e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The two benchmarks graphicslayout and graphicslinearlayout were
disabled for some time. Fixed the compile errors and readded them so
there is at least no bitrotting.
Task-number: QTBUG-27461
Change-Id: Ib0c878e97693c0ad3bf87e658d493da61f5174ee
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
tst_QGraphicsItem::setPos() was provided with test data
but it was not used.
Change-Id: I8ed2a1ef9940024e4a0e666276f0953706869ef7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Move all widget-dependent benchmarks which were still in gui
subdirectory to widgets
Task-number: QTBUG-23129
Change-Id: I1359f1ea4036cacdfdbe08ff9ecdf1e2c75a005b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QImagereader benchmark does neither depend on network nor widgets.
Therefore those two dependencies can be removed here.
Change-Id: Ic127b2668e22608774ce5878454f4a96ef591f6b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The test has been flaky on top of QEMU. The test is clearly a sort of manually
rolled benchmark, not a regular autotest. Remove the test and replace it with a
benchmark in QObjectBenchmark.
Task-number: QTBUG-66823
Task-number: QTBUG-66216
Change-Id: I7a48293023f32141eed6fea50fbb63af18933a8f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Avoid lots of warnings about not being able to set "modal".
Change-Id: I396718f14a55203f9989c03e20efc647c64795a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>