Tests: avoid use of stderr as name for variables and objects

On CYGWIN, I configured with -developer-build option and the build
process fails at this point:

qtbase/tests/auto/tools/moc/tst_moc.cpp: In member function ‘void tst_Moc::initTestCase()’:
qtbase/tests/auto/tools/moc/tst_moc.cpp:940:9: error: expected primary-expression before ‘const’
  940 |         const QByteArray stderr = p.readAllStandardError(); \
      |         ^~~~~
qtbase/tests/auto/tools/moc/tst_moc.cpp:941:25: error: request for member ‘isEmpty’ in ‘__getreent()->_reent::_stderr’, which is of pointer type ‘__FILE*’ (maybe you meant to use ‘->’ ?)
  941 |         QVERIFY2(stderr.isEmpty(), stderr.data()); \
      |                         ^~~~~~~

It looks like that it doesn't like to use stderr word in that manner.
Inside VERIFY_NO_ERRORS macro, I just renamed stderr to standardError
and the problem was solved.

Change-Id: I21e5a785b35db518efffccecf796b88c78ebc725
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Carlo Bramini 2025-01-04 18:27:10 +01:00
parent 05d090b8e7
commit 48573ddda3

View File

@ -936,8 +936,8 @@ private:
#define VERIFY_NO_ERRORS(proc) do { \
auto &&p = proc; \
const QByteArray stderr = p.readAllStandardError(); \
QVERIFY2(stderr.isEmpty(), stderr.data()); \
const QByteArray standardError = p.readAllStandardError(); \
QVERIFY2(standardError.isEmpty(), standardError.data()); \
QCOMPARE(p.exitCode(), 0); \
} while (false)