Commit 16ca7099 authored by David Schulz's avatar David Schulz Committed by Nikolai Kosjar

Clang: Fix assert in code completion test

Assertion failed: IncludeBriefComments == this-
>IncludeBriefCommentsInCodeCompletion, file C:\dev\src\llvm-381\tools
\clang\lib\Frontend\ASTUnit.cpp, line 2337

Only occurs when linked again a debug llvm.

Change-Id: I6a37875fe95852ee2afcef7f6b6b38e9669a6584
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 03923fc5
......@@ -47,6 +47,12 @@ using ClangBackEnd::TranslationUnit;
using ClangBackEnd::UnsavedFiles;
using ClangBackEnd::ProjectPart;
static unsigned completionOptions(const TranslationUnit &translationUnit)
{
return translationUnit.defaultOptions() & CXTranslationUnit_IncludeBriefCommentsInCodeCompletion
? CXCodeComplete_IncludeBriefComments : 0;
}
TEST(ClangCodeCompleteResults, GetData)
{
ProjectPart projectPart(Utf8StringLiteral("projectPartId"));
......@@ -58,7 +64,11 @@ TEST(ClangCodeCompleteResults, GetData)
Utf8StringVector(),
translationUnits);
Utf8String nativeFilePath = FilePath::toNativeSeparators(translationUnit.filePath());
CXCodeCompleteResults *cxCodeCompleteResults = clang_codeCompleteAt(translationUnit.cxTranslationUnit(), nativeFilePath.constData(), 49, 1, 0, 0, 0);
CXCodeCompleteResults *cxCodeCompleteResults =
clang_codeCompleteAt(translationUnit.cxTranslationUnit(),
nativeFilePath.constData(),
49, 1, 0, 0,
completionOptions(translationUnit));
ClangCodeCompleteResults codeCompleteResults(cxCodeCompleteResults);
......@@ -85,7 +95,11 @@ TEST(ClangCodeCompleteResults, MoveClangCodeCompleteResults)
Utf8StringVector(),
translationUnits);
Utf8String nativeFilePath = FilePath::toNativeSeparators(translationUnit.filePath());
CXCodeCompleteResults *cxCodeCompleteResults = clang_codeCompleteAt(translationUnit.cxTranslationUnit(), nativeFilePath.constData(), 49, 1, 0, 0, 0);
CXCodeCompleteResults *cxCodeCompleteResults =
clang_codeCompleteAt(translationUnit.cxTranslationUnit(),
nativeFilePath.constData(),
49, 1, 0, 0,
completionOptions(translationUnit));
ClangCodeCompleteResults codeCompleteResults(cxCodeCompleteResults);
......
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