diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-21 19:07:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-21 19:07:53 +0100 |
commit | 65faf4565595d91996ddec4af25af5e97c7f0317 (patch) | |
tree | a7415e90db3fa1e46f638e1c31d2f2b9a5d0ec4a /tests/auto/corelib/tools | |
parent | a9383ef99a29c333a1edd32695ddc29ea0ba805d (diff) | |
parent | 26bc4ac5cb56ce8f2d3d10125fa9c6a72140573a (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
src/plugins/platforms/eglfs/eglfs-plugin.pro
Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qchar/tst_qchar.cpp | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index 13898ace7b..e5a6e953d3 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -36,7 +36,7 @@ class tst_QChar : public QObject { Q_OBJECT private slots: - void operator_eqeq_int(); + void operator_eqeq_null(); void operators_data(); void operators(); void toUpper(); @@ -72,35 +72,54 @@ private slots: void unicodeVersion(); }; -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -void tst_QChar::operator_eqeq_int() +void tst_QChar::operator_eqeq_null() { { const QChar ch = QLatin1Char(' '); - QVERIFY(ch != 0); - QVERIFY(!(ch == 0)); - - QVERIFY(ch == 0x20); - QVERIFY(!(ch != 0x20)); - QVERIFY(0x20 == ch); - QVERIFY(!(0x20 != ch)); +#define CHECK(NUL) \ + do { \ + QVERIFY(!(ch == NUL)); \ + QVERIFY( ch != NUL ); \ + QVERIFY(!(ch < NUL)); \ + QVERIFY( ch > NUL ); \ + QVERIFY(!(ch <= NUL)); \ + QVERIFY( ch >= NUL ); \ + QVERIFY(!(NUL == ch )); \ + QVERIFY( NUL != ch ); \ + QVERIFY( NUL < ch ); \ + QVERIFY(!(NUL > ch )); \ + QVERIFY( NUL <= ch ); \ + QVERIFY(!(NUL >= ch )); \ + } while (0) + + CHECK(0); + CHECK('\0'); +#undef CHECK } { const QChar ch = QLatin1Char('\0'); - QVERIFY(ch == 0); - QVERIFY(!(ch != 0)); - - QVERIFY(ch != 0x20); - QVERIFY(!(ch == 0x20)); - QVERIFY(0x20 != ch); - QVERIFY(!(0x20 == ch)); +#define CHECK(NUL) \ + do { \ + QVERIFY( ch == NUL ); \ + QVERIFY(!(ch != NUL)); \ + QVERIFY(!(ch < NUL)); \ + QVERIFY(!(ch > NUL)); \ + QVERIFY( ch <= NUL ); \ + QVERIFY( ch >= NUL ); \ + QVERIFY( NUL == ch ); \ + QVERIFY(!(NUL != ch )); \ + QVERIFY(!(NUL < ch )); \ + QVERIFY(!(NUL > ch )); \ + QVERIFY( NUL <= ch ); \ + QVERIFY( NUL >= ch ); \ + } while (0) + + CHECK(0); + CHECK('\0'); +#undef CHECK } } -QT_WARNING_POP - void tst_QChar::operators_data() { QTest::addColumn<QChar>("lhs"); |