tst_qfile: fix GCC 13.2.1 compiler warning [-Wenum-compare]
By using "wt" for all OS's; according to Thiago the 't' is ignored everywhere except on Windows. tests/auto/corelib/io/qfile/tst_qfile.cpp:2846:70: warning: comparison between ‘enum QOperatingSystemVersionBase::OSType’ and ‘enum QOperatingSystemVersion::OSType’ [-Wenum-compare] 2846 | const char *openMode = QOperatingSystemVersion::current().type() != QOperatingSystemVersion::Windows | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Amends 3446313c7a5cd6005089866a7b20c9f28e132a0a Pick-to: 6.6 6.5 6.2 Change-Id: I310d7d6ce3833756ffdc47b000e052ef3afdfdef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d7340d5c31c8ce79724af9592453d3cf55262fa4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
cac3d31988
commit
b6a5528369
@ -2843,9 +2843,8 @@ void tst_QFile::socketPair()
|
||||
|
||||
void tst_QFile::textFile()
|
||||
{
|
||||
const char *openMode = QOperatingSystemVersion::current().type() != QOperatingSystemVersion::Windows
|
||||
? "w" : "wt";
|
||||
StdioFileGuard fs(fopen("writeabletextfile", openMode));
|
||||
// The "t" is ignored everywhere except on Windows
|
||||
StdioFileGuard fs(fopen("writeabletextfile", "wt"));
|
||||
QVERIFY(fs);
|
||||
QFile f;
|
||||
QByteArray part1("This\nis\na\nfile\nwith\nnewlines\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user