diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2013-12-18 23:26:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-15 14:55:20 +0200 |
commit | 78a1c46a86e205e599d641ffb3eae721705e0d1e (patch) | |
tree | 50f9172687afdacd1943826360612615e3704ea4 /tests | |
parent | b526e44a37776861b187de62ebc4e21ba4c67cc4 (diff) |
Mark each QT_MOC_LITERAL usage with a comment
The comment shows to which string a QT_MOC_LITERAL is pointing.
Change-Id: Ia389d750b1b1c21e2242bad6beceea4f9298ff8e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 04140fa4a1..c5469bd33a 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -174,6 +174,9 @@ class TestClassinfoWithEscapes: public QObject Q_OBJECT Q_CLASSINFO("escaped", "\"bar\"") Q_CLASSINFO("\"escaped\"", "foo") + Q_CLASSINFO("cpp c*/omment", "f/*oo") + Q_CLASSINFO("endswith\\", "Or?\?/") + Q_CLASSINFO("newline\n inside\n", "Or \r") public slots: void slotWithAReallyLongName(int) { } @@ -800,6 +803,14 @@ void tst_Moc::classinfoWithEscapes() const QMetaObject *mobj = &TestClassinfoWithEscapes::staticMetaObject; QCOMPARE(mobj->methodCount() - mobj->methodOffset(), 1); + QCOMPARE(mobj->classInfoCount(), 5); + QCOMPARE(mobj->classInfo(2).name(), "cpp c*/omment"); + QCOMPARE(mobj->classInfo(2).value(), "f/*oo"); + QCOMPARE(mobj->classInfo(3).name(), "endswith\\"); + QCOMPARE(mobj->classInfo(3).value(), "Or?\?/"); + QCOMPARE(mobj->classInfo(4).name(), "newline\n inside\n"); + QCOMPARE(mobj->classInfo(4).value(), "Or \r"); + QMetaMethod mm = mobj->method(mobj->methodOffset()); QCOMPARE(mm.methodSignature(), QByteArray("slotWithAReallyLongName(int)")); } |