diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-01-09 13:03:47 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2024-01-10 08:45:48 +0000 |
| commit | 93af86bad566bf4c2c0a5fa7f64e84daaa20a311 (patch) | |
| tree | 9b41cbd6bc760b14c62aeb30f8c317034b1d9870 /src/network/access/qrestreply.cpp | |
| parent | ca2f46c04c26ed4649cb6c2c62d3b2e52cd8d5ad (diff) | |
tst_moc: DRY QProcess success verification
While the code that checked that exitCode() == 0 was still consistent
between all the callers, when it comes to checking stderr, there were
several competing implementations, incl. checking the exitCode and
dumping stderr to qDebug(), and using QCOMPARE to QByteArray(),
presumably in order to get more detailed output on error. Alas,
QCOMPARE's toString() truncates output pretty early, making it
impossible to see what's going on on failure.
So write a small macro that checks the exitCode _after_ it checked
that stderr was empty (printing it in full if it was not), so we
consistently get the error message instead of a truncated version, or
just "exitCode() != 0" without further details.
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ic8547fda3b02c645901962887c6ed7aad01f6ea4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/network/access/qrestreply.cpp')
0 files changed, 0 insertions, 0 deletions
