qt5base-lts/tests/auto
Edward Welbourne 7bac62f8cd Use lists and arrays more gracefully in tst_qsqlquery
Use initializer lists rather than << entries.
Use arrays where we don't need the lists at all.
Make them const when they can be.
Replace foreach with ranged-for.
Use auto rather than naming iterator types and save end() at the start
of the iteration to save re-requesting it each time round the loop.

Reverse arguments to a QCOMPARE() as actual should come first and
expected after, not the other way round. Change some casts from
C-style to type-as-function-style, use QString literals rather than
C-string literals that would need conversion at compile time and
QLatin1String::arg in preference to arithmetic where the same format
is duplicated.

In the process, reworked one test to put its two iterations, one over
good query strings, one over bad ones, into separate blocks using
separate const arrays, instead of reusing a list with an uninformative
name.

Change-Id: I4a272be3eb58e9dca136238277b92379d6ca076d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-15 17:32:47 +01:00
..
bic/data Add BC files for 6.2.0 2022-01-07 13:31:38 +00:00
cmake Bump version from 6.2.0 to 6.4.0 in tests as well 2022-01-31 17:20:06 +02:00
concurrent Fix memory leak in QtConcurrent::run when called with a NULL QThreadPool 2022-01-24 22:40:35 +01:00
corelib Convert a table iteration to use ranged-for 2022-02-15 15:44:51 +01:00
dbus tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
gui QDesktopServices: deprecate destroying URL handlers w/o explicit unsetUrlHandler() 2022-02-15 12:20:16 +00:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network QAbstractSocket: Don't pretend pause and resume is a stack 2022-02-09 22:26:20 +01:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other QIODevice: use QVLA to hold the ring buffers, not QList 2021-12-15 17:35:13 +00:00
printsupport QtBase: replace windows.h with qt_windows.h 2021-11-23 12:53:46 +08:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql Use lists and arrays more gracefully in tst_qsqlquery 2022-02-15 17:32:47 +01:00
testlib CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
tools Add missing implicit dependencies to the tool tests 2022-02-09 15:33:46 +01:00
widgets Position QCompleter popup based on the widget's screen geometry 2022-02-15 01:28:30 +00:00
xml QDomDocument::setContent: Open device if necessary 2021-11-09 18:33:39 +01:00
CMakeLists.txt Don't build tests/auto/tools when cross-compiling 2021-10-07 08:03:40 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00