diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-11-22 11:03:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-23 17:04:00 +0100 |
commit | aea68c93ae437a761584719f0f1ca93eaf6f7484 (patch) | |
tree | 09f7bb24a1ec26c96db27be9bfeb61ed6c3da8e4 /tests/auto/tools/moc/tst_moc.cpp | |
parent | 436e3dc4f961b4ea6c541d1fdf82e476ac10597c (diff) |
Proper macro replacment and branch evaluation
Correclty replace macros according to the C++ standard.
Use the correct replacement method also to evaluate
With this moc correctly processes boost headers.
Task-number: QTBUG-27546
Change-Id: I001b3054c5fcdc34d46cfa53d1387bd19436f361
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index d861b84e00..e3ed473978 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -2752,19 +2752,34 @@ void tst_Moc::parseDefines() QVERIFY(index != -1); #endif + index = mo->indexOfSlot("INNERFUNCTION(int)"); + QVERIFY(index != -1); + index = mo->indexOfSlot("inner_expanded(int)"); + QVERIFY(index != -1); + index = mo->indexOfSlot("expanded_method(int)"); + QVERIFY(index != -1); + + index = mo->indexOfSlot("conditionSlot()"); + QVERIFY(index != -1); + int count = 0; for (int i = 0; i < mo->classInfoCount(); ++i) { QMetaClassInfo mci = mo->classInfo(i); if (!qstrcmp(mci.name(), "TestString")) { ++count; - QVERIFY(!qstrcmp(mci.value(), "ParseDefine")); + QVERIFY(!qstrcmp(mci.value(), "PD_CLASSNAME")); } if (!qstrcmp(mci.name(), "TestString2")) { ++count; + qDebug() << mci.value(); + QVERIFY(!qstrcmp(mci.value(), "ParseDefine")); + } + if (!qstrcmp(mci.name(), "TestString3")) { + ++count; QVERIFY(!qstrcmp(mci.value(), "TestValue")); } } - QVERIFY(count == 2); + QVERIFY(count == 3); } void tst_Moc::preprocessorOnly() |