Commit 800e962c authored by Bill King's avatar Bill King
Browse files

tests: Add a failing test to make sure diagnostic reporting is working.

parent 46ecaecc
......@@ -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*/)
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);
#include "tst_semantic.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment