forked from qt-creator/qt-creator
C++: Added tests for C++11 features.
Change-Id: Ifa0bc37916d3ac3a523580bec15a6685709e7810 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -118,6 +118,10 @@ private Q_SLOTS:
|
||||
//
|
||||
void inlineNamespace_data();
|
||||
void inlineNamespace();
|
||||
void staticAssert();
|
||||
void staticAssert_data();
|
||||
void noExcept();
|
||||
void noExcept_data();
|
||||
|
||||
//
|
||||
// checks for the semantic
|
||||
@@ -164,5 +168,49 @@ void tst_cxx11::inlineNamespaceLookup()
|
||||
QCOMPARE(results.size(), 1); // the symbol is visible from the global scope
|
||||
}
|
||||
|
||||
void tst_cxx11::staticAssert_data()
|
||||
{
|
||||
QTest::addColumn<QString>("file");
|
||||
QTest::addColumn<QString>("errorFile");
|
||||
|
||||
QTest::newRow("staticAssert.1") << "staticAssert.1.cpp" << "staticAssert.1.errors.txt";
|
||||
}
|
||||
|
||||
void tst_cxx11::staticAssert()
|
||||
{
|
||||
QFETCH(QString, file);
|
||||
QFETCH(QString, errorFile);
|
||||
|
||||
QByteArray errors;
|
||||
Document::Ptr doc = document(file, &errors);
|
||||
|
||||
if (! qgetenv("DEBUG").isNull())
|
||||
printf("%s\n", errors.constData());
|
||||
|
||||
VERIFY_ERRORS();
|
||||
}
|
||||
|
||||
void tst_cxx11::noExcept_data()
|
||||
{
|
||||
QTest::addColumn<QString>("file");
|
||||
QTest::addColumn<QString>("errorFile");
|
||||
|
||||
QTest::newRow("noExcept.1") << "noExcept.1.cpp" << "noExcept.1.errors.txt";
|
||||
}
|
||||
|
||||
void tst_cxx11::noExcept()
|
||||
{
|
||||
QFETCH(QString, file);
|
||||
QFETCH(QString, errorFile);
|
||||
|
||||
QByteArray errors;
|
||||
Document::Ptr doc = document(file, &errors);
|
||||
|
||||
if (! qgetenv("DEBUG").isNull())
|
||||
printf("%s\n", errors.constData());
|
||||
|
||||
VERIFY_ERRORS();
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_cxx11)
|
||||
#include "tst_cxx11.moc"
|
||||
|
||||
Reference in New Issue
Block a user