qt6-bb10/tests/auto/corelib
Marc Mutz ed19fc0531 QFileSystemWatcher: lock autotest code away into a cold section
The code contained a sizeable chunk of string parsing along with
qDebug()s in the normal path of execution. That code, however, was
only used for Qt's own autotests.

The idea of this patch is, then, to not only move the autotest case
into the cold text section (using Q_UNLIKELY), but also to completely
exclude it, when QT_BUILD_INTERNAL is not set.

Unfortunately, the structure of the function did not really lend
itself to #ifdefing that part of the code out (production code was in
the middle of non-production code), so I transformed the engine
selection code into a lambda, replacing assignment with returns, and
swapping the branches of the central if around to yield a single block
of code that can be excluded from compilation with just one #ifdef.

As a consequence, the runtime code is almost unaffected, and the
function is much easier to read now.

Since the test-specific code is only compiled into Qt now in developer
builds, guard the tests that rely on this behavior with the same macro.

Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-21 12:58:27 +02:00
..
animation Extend blacklisting of tst_qparallelanimationgroup tests to macOS 10.13 2018-09-24 21:13:30 +00:00
codecs Add tests for decoding too-short UTF-8 sequences 2018-09-25 22:14:07 +00:00
global tst_qrandomgenerator: replace QLinkedList with a std::list 2019-05-14 05:28:14 +00:00
io QFileSystemWatcher: lock autotest code away into a cold section 2019-05-21 12:58:27 +02:00
itemmodels Replace qMove with std::move 2019-04-06 11:00:38 +00:00
kernel Merge remote-tracking branch 'origin/5.13' into dev 2019-05-13 08:04:58 +02:00
mimetypes Remove handling of missing Q_COMPILER_RVALUE_REFS 2019-05-01 20:24:45 +00:00
plugin moc: Add a standard way of specifying a URI as part of Q_PLUGIN_METADATA 2019-04-11 14:43:27 +00:00
serialization Merge remote-tracking branch 'origin/5.13' into dev 2019-05-15 07:11:41 +02:00
statemachine QStateMachine: handle parallel child mode for state machines 2019-05-16 16:51:42 +02:00
thread Replace qMove with std::move 2019-04-06 11:00:38 +00:00
tools Merge remote-tracking branch 'origin/5.13' into dev 2019-05-13 08:04:58 +02:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00