diff options
author | Bill King <bill.king@nokia.com> | 2011-02-17 16:59:35 +0100 |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2011-02-17 17:00:09 +0100 |
commit | 800e962c3368ea4b0b9a5ddbf040f63f3f7f12f1 (patch) | |
tree | 987b1dbc871939d4902346c6994182abef9e7a4a /tests | |
parent | 46ecaecc13d91de686fdbadb19194742bf6c6eb7 (diff) | |
download | qt-creator-800e962c3368ea4b0b9a5ddbf040f63f3f7f12f1.tar.gz |
tests: Add a failing test to make sure diagnostic reporting is working.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cplusplus/semantic/tst_semantic.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/cplusplus/semantic/tst_semantic.cpp b/tests/auto/cplusplus/semantic/tst_semantic.cpp index 76437a4700..0f4e355c12 100644 --- a/tests/auto/cplusplus/semantic/tst_semantic.cpp +++ b/tests/auto/cplusplus/semantic/tst_semantic.cpp @@ -83,13 +83,13 @@ public: { } virtual void report(int /*level*/, - const StringLiteral *fileName, - unsigned line, unsigned column, - const char *format, va_list ap) + const StringLiteral * /*fileName*/, + unsigned /*line*/, unsigned /*column*/, + const char * /*format*/, va_list /*ap*/) { ++errorCount; - qDebug() << fileName->chars()<<':'<<line<<':'<<column<<' '<<QString().vsprintf(format, ap); +// qDebug() << fileName->chars()<<':'<<line<<':'<<column<<' '<<QString().vsprintf(format, ap); } }; @@ -132,6 +132,8 @@ private slots: void objcSelector_2(); void q_enum_1(); + + void diagnostic_error(); }; void tst_Semantic::function_declaration_1() @@ -664,5 +666,15 @@ void tst_Semantic::q_enum_1() QCOMPARE(e->name->identifier()->chars(), "e"); } +void tst_Semantic::diagnostic_error() +{ + QSharedPointer<Document> doc = document("\n" + "class Foo {}\n", + false, false); + + QCOMPARE(doc->errorCount, 1U); + QCOMPARE(doc->globals->memberCount(), 1U); +} + QTEST_APPLESS_MAIN(tst_Semantic) #include "tst_semantic.moc" |