diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2024-03-11 22:39:09 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2024-03-12 23:28:34 +0200 |
commit | d7340d5c31c8ce79724af9592453d3cf55262fa4 (patch) | |
tree | b8f6259549bd036dd52ef144ae3bc0315f994790 /tests/auto/corelib/io/qfile/tst_qfile.cpp | |
parent | dea548ef040c95d6fd6796051b12f148372b0f22 (diff) |
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.7 6.6 6.5 6.2
Change-Id: I310d7d6ce3833756ffdc47b000e052ef3afdfdef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 39533749aa..9cf267be1f 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -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"); |