C++: Tests: Reset diagnostic messages

...otherwise they add up and subsequent tests checking for the error count will
fail:

FAIL!  : tst_AST::objc_try_statement_1() Compared values are not the same
   Actual   (diag.errorCount): 5
   Expected (0): 0
   Loc: [/home/nikolai/dev/creator/qtcreator-master/tests/auto/cplusplus/ast/tst_ast.cpp(1400)]
...

Change-Id: I8b4356331e95dceb1e99bb26e6ebf4591d70a08c
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-08-21 15:46:30 +02:00
parent 72ab719484
commit 2555c21158

View File

@@ -94,6 +94,7 @@ public:
private slots:
void initTestCase();
void cleanup();
// line/column positions
void line_and_column_1();
@@ -1687,6 +1688,11 @@ void tst_AST::initTestCase()
control.setDiagnosticClient(&diag);
}
void tst_AST::cleanup()
{
diag.errorCount = 0;
}
void tst_AST::line_and_column_1()
{
QSharedPointer<TranslationUnit> unit(parseDeclaration("\n"