summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unittest/data/highlightingmarks.cpp9
-rw-r--r--tests/unit/unittest/tokenprocessor-test.cpp18
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/unittest/data/highlightingmarks.cpp b/tests/unit/unittest/data/highlightingmarks.cpp
index e1a48903ca..a703e89a11 100644
--- a/tests/unit/unittest/data/highlightingmarks.cpp
+++ b/tests/unit/unittest/data/highlightingmarks.cpp
@@ -686,3 +686,12 @@ class NonConstParameterConstructor
NonConstParameterConstructor bar(foo);
}
};
+
+class StaticMembersAccess
+{
+protected:
+ static int protectedValue;
+
+private:
+ static int privateValue;
+};
diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp
index 3383c9a3b9..8d79bc95cb 100644
--- a/tests/unit/unittest/tokenprocessor-test.cpp
+++ b/tests/unit/unittest/tokenprocessor-test.cpp
@@ -1704,6 +1704,24 @@ TEST_F(TokenProcessor, LambdaLocalVariableCapture)
ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable));
}
+TEST_F(TokenProcessor, StaticProtectedMember)
+{
+ const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(693, 31));
+
+ ClangBackEnd::TokenInfoContainer container(infos[2]);
+
+ ASSERT_THAT(container.extraInfo.accessSpecifier, ClangBackEnd::AccessSpecifier::Protected);
+}
+
+TEST_F(TokenProcessor, StaticPrivateMember)
+{
+ const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(696, 29));
+
+ ClangBackEnd::TokenInfoContainer container(infos[2]);
+
+ ASSERT_THAT(container.extraInfo.accessSpecifier, ClangBackEnd::AccessSpecifier::Private);
+}
+
Data *TokenProcessor::d;
void TokenProcessor::SetUpTestCase()