summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qchar/tst_qchar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qchar/tst_qchar.cpp')
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index 32002fe7ed..29e48a1cc8 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -44,6 +44,7 @@ class tst_QChar : public QObject
{
Q_OBJECT
private slots:
+ void operator_eqeq_int();
void operators_data();
void operators();
void toUpper();
@@ -79,6 +80,30 @@ private slots:
void unicodeVersion();
};
+void tst_QChar::operator_eqeq_int()
+{
+ {
+ const QChar ch = QLatin1Char(' ');
+ QVERIFY(ch != 0);
+ QVERIFY(!(ch == 0));
+
+ QVERIFY(ch == 0x20);
+ QVERIFY(!(ch != 0x20));
+ QVERIFY(0x20 == ch);
+ QVERIFY(!(0x20 != ch));
+ }
+ {
+ const QChar ch = QLatin1Char('\0');
+ QVERIFY(ch == 0);
+ QVERIFY(!(ch != 0));
+
+ QVERIFY(ch != 0x20);
+ QVERIFY(!(ch == 0x20));
+ QVERIFY(0x20 != ch);
+ QVERIFY(!(0x20 == ch));
+ }
+}
+
void tst_QChar::operators_data()
{
QTest::addColumn<QChar>("lhs");