Commit f7854029 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Cleanup test_cpppreprocessor_includes

Use QCOMPARE instead of QVERIFY where appropriate.

Change-Id: I7965a00fd004b8c3a20186bb692bf541f154d12b
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent b844ef43
......@@ -90,7 +90,8 @@ private:
CppModelManager *m_cmm;
};
void CppToolsPlugin::test_cpppreprocessor_includes()
/// Check: Resolved and unresolved includes are properly tracked.
void CppToolsPlugin::test_cpppreprocessor_includes_resolvedUnresolved()
{
QByteArray source =
"#include \"header.h\"\n"
......@@ -103,17 +104,16 @@ void CppToolsPlugin::test_cpppreprocessor_includes()
QVERIFY(document);
const QList<Document::Include> resolvedIncludes = document->resolvedIncludes();
QVERIFY(resolvedIncludes.size() == 1);
QVERIFY(resolvedIncludes.at(0).type() == Client::IncludeLocal);
QCOMPARE(resolvedIncludes.size(), 1);
QCOMPARE(resolvedIncludes.at(0).type(), Client::IncludeLocal);
QCOMPARE(resolvedIncludes.at(0).unresolvedFileName(), QLatin1String("header.h"));
const QString expectedResolvedFileName
= TestIncludePaths::testFilePath(QLatin1String("header.h"));
QCOMPARE(resolvedIncludes.at(0).resolvedFileName(), expectedResolvedFileName);
const QList<Document::Include> unresolvedIncludes = document->unresolvedIncludes();
QVERIFY(unresolvedIncludes.size() == 1);
QVERIFY(unresolvedIncludes.at(0).type() == Client::IncludeLocal);
QCOMPARE(unresolvedIncludes.size(), 1);
QCOMPARE(unresolvedIncludes.at(0).type(), Client::IncludeLocal);
QCOMPARE(unresolvedIncludes.at(0).unresolvedFileName(), QLatin1String("notresolvable.h"));
QVERIFY(unresolvedIncludes.at(0).resolvedFileName().isEmpty());
}
......@@ -122,7 +122,7 @@ private slots:
void test_format_pointerdeclaration_macros();
void test_format_pointerdeclaration_macros_data();
void test_cpppreprocessor_includes();
void test_cpppreprocessor_includes_resolvedUnresolved();
void test_functionutils_virtualFunctions();
void test_functionutils_virtualFunctions_data();
......
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