Commit e6e30c3f authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by David Schulz

CppEditor: Tests: Add initial Follow Symbol Under Cursor tests

Test cases are examples from

    Working Draft, Standard for Programming Language C++
    Document Number: N3242=11-0012

Change-Id: I624c315943d6a00e821abb52eef6e0ff4a40f0d7
Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent c702639a
......@@ -42,7 +42,8 @@ equals(TEST, 1) {
SOURCES += \
cppquickfix_test.cpp \
cppdoxygen_test.cpp \
fileandtokenactions_test.cpp
fileandtokenactions_test.cpp \
followsymbolundercursor_test.cpp
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
......@@ -61,6 +61,7 @@ QtcPlugin {
"cppdoxygen_test.cpp",
"cppquickfix_test.cpp",
"fileandtokenactions_test.cpp",
"followsymbolundercursor_test.cpp"
]
cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"'])
......
......@@ -93,6 +93,29 @@ private slots:
#ifdef WITH_TESTS
private slots:
// The following tests expect that no projects are loaded on start-up.
void test_FollowSymbolUnderCursor_globalVarFromFunction();
void test_FollowSymbolUnderCursor_funLocalVarHidesClassMember();
void test_FollowSymbolUnderCursor_funLocalVarHidesNamespaceMemberIntroducedByUsingDirective();
void test_FollowSymbolUnderCursor_loopLocalVarHidesOuterScopeVariable1();
void test_FollowSymbolUnderCursor_loopLocalVarHidesOuterScopeVariable2();
void test_FollowSymbolUnderCursor_subsequentDefinedClassMember();
void test_FollowSymbolUnderCursor_classMemberHidesOuterTypeDef();
void test_FollowSymbolUnderCursor_globalVarFromEnum();
void test_FollowSymbolUnderCursor_selfInitialization();
void test_FollowSymbolUnderCursor_pointerToClassInClassDefinition();
void test_FollowSymbolUnderCursor_previouslyDefinedMemberFromArrayDefinition();
void test_FollowSymbolUnderCursor_outerStaticMemberVariableFromInsideSubclass();
void test_FollowSymbolUnderCursor_memberVariableFollowingDotOperator();
void test_FollowSymbolUnderCursor_memberVariableFollowingArrowOperator();
void test_FollowSymbolUnderCursor_staticMemberVariableFollowingScopeOperator();
void test_FollowSymbolUnderCursor_staticMemberVariableFollowingDotOperator();
void test_FollowSymbolUnderCursor_staticMemberVariableFollowingArrowOperator();
void test_FollowSymbolUnderCursor_previouslyDefinedEnumValueFromInsideEnum();
void test_FollowSymbolUnderCursor_nsMemberHidesNsMemberIntroducedByUsingDirective();
void test_FollowSymbolUnderCursor_baseClassFunctionIntroducedByUsingDeclaration();
void test_FollowSymbolUnderCursor_funWithSameNameAsBaseClassFunIntroducedByUsingDeclaration();
void test_FollowSymbolUnderCursor_funLocalVarHidesOuterClass();
void test_doxygen_comments_qt_style();
void test_doxygen_comments_qt_style_continuation();
void test_doxygen_comments_java_style();
......
This diff is collapsed.
......@@ -164,6 +164,16 @@ unsigned CppEditorSupport::editorRevision() const
return m_textEditor->editorWidget()->document()->revision();
}
bool CppEditorSupport::isDocumentBeingUpdated() const
{
return m_documentParser.isRunning();
}
bool CppEditorSupport::isDocumentScheduledForUpdate() const
{
return m_updateDocumentTimer->isActive();
}
void CppEditorSupport::setExtraDiagnostics(const QString &key,
const QList<Document::DiagnosticMessage> &messages)
{
......
......@@ -95,6 +95,9 @@ public:
QString contents() const;
unsigned editorRevision() const;
bool isDocumentBeingUpdated() const;
bool isDocumentScheduledForUpdate() const;
void setExtraDiagnostics(const QString &key,
const QList<CPlusPlus::Document::DiagnosticMessage> &messages);
......
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