Commit 3baa1b35 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

C++: Ensure test code is free of diagnostic messages in tst_checksymbols.cpp



Change-Id: I11b3caf354d57f08268cca7bc2944ca7ae386bfb
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 5cddad9d
......@@ -124,6 +124,7 @@ public:
document->setUtf8Source(preprocessedSource);
QVERIFY(document->parse(parseMode));
document->check();
QVERIFY(document->diagnosticMessages().isEmpty());
snapshot.insert(document);
}
......@@ -263,12 +264,14 @@ void tst_CheckSymbols::test_checksymbols_EnumerationUse()
{
const QByteArray source =
"enum E { Red, Green, Blue };\n"
"E e = Red\n";
"E e = Red;\n";
const QList<Use> expectedUses = QList<Use>()
<< Use(1, 6, 1, CppHighlightingSupport::TypeUse)
<< Use(1, 10, 3, CppHighlightingSupport::EnumerationUse)
<< Use(1, 15, 5, CppHighlightingSupport::EnumerationUse)
<< Use(1, 22, 4, CppHighlightingSupport::EnumerationUse)
<< Use(2, 1, 1, CppHighlightingSupport::TypeUse)
<< Use(2, 7, 3, CppHighlightingSupport::EnumerationUse)
;
TestData::check(source, expectedUses);
......@@ -313,7 +316,7 @@ void tst_CheckSymbols::test_checksymbols_MacroUse()
{
const QByteArray source =
"#define FOO 1+1\n"
"int f() { FOO }\n";
"int f() { FOO; }\n";
const QList<Use> macroUses = QList<Use>()
<< Use(1, 9, 3, CppHighlightingSupport::MacroUse)
<< Use(2, 11, 3, CppHighlightingSupport::MacroUse);
......@@ -877,7 +880,7 @@ void tst_CheckSymbols::test_checksymbols_QTCREATORBUG8974_danglingPointer()
" Singleton<INIManager>::instance().bar();\n"
" Singleton<INIManager>::instance().bar();\n"
" Singleton<INIManager>::instance().bar();\n"
"};\n"
"}\n"
;
const QList<Use> expectedUses = QList<Use>()
......@@ -1477,7 +1480,7 @@ void tst_CheckSymbols::test_checksymbols_QTCREATORBUG9098()
" {\n"
" b.c;\n"
" }\n"
"}\n"
"};\n"
;
const QList<Use> expectedUses = QList<Use>()
......
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