summaryrefslogtreecommitdiff
path: root/tests/unit/unittest
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@theqtcompany.com>2015-12-09 15:16:55 +0100
committerMarco Bubke <marco.bubke@theqtcompany.com>2015-12-16 15:28:27 +0000
commit18fa35c1529f247eac4caa8434c344d37c3629ce (patch)
tree49d5a6c864b66bfe0913e34527d4d4480ee82eb2 /tests/unit/unittest
parent8d6c10b2416c38e93e0ff53f677c31ba711ad0ae (diff)
downloadqt-creator-18fa35c1529f247eac4caa8434c344d37c3629ce.tar.gz
Clang: Fix highlighting for using a namespaced type
using NameSpace::StructInNameSpace; Task-number: QTCREATORBUG-15271 Change-Id: I17a3ad1e1eed7a820ed7dead5d15a3de760c135f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'tests/unit/unittest')
-rw-r--r--tests/unit/unittest/data/highlightinginformations.cpp2
-rw-r--r--tests/unit/unittest/highlightinginformationstest.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/unit/unittest/data/highlightinginformations.cpp b/tests/unit/unittest/data/highlightinginformations.cpp
index ca7eaa392f..8d341164fc 100644
--- a/tests/unit/unittest/data/highlightinginformations.cpp
+++ b/tests/unit/unittest/data/highlightinginformations.cpp
@@ -162,7 +162,7 @@ struct StructInNameSpace {};
}
namespace NameSpaceAlias = NameSpace;
-
+using NameSpace::StructInNameSpace;
NameSpace::StructInNameSpace foo6;
class BaseClass {
diff --git a/tests/unit/unittest/highlightinginformationstest.cpp b/tests/unit/unittest/highlightinginformationstest.cpp
index 29e68042b6..bf9f4a33f8 100644
--- a/tests/unit/unittest/highlightinginformationstest.cpp
+++ b/tests/unit/unittest/highlightinginformationstest.cpp
@@ -462,6 +462,13 @@ TEST_F(HighlightingInformations, NameSpaceAlias)
ASSERT_THAT(infos[1], HasType(HighlightingType::Type));
}
+TEST_F(HighlightingInformations, UsingStructInNameSpace)
+{
+ const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(165, 36));
+
+ ASSERT_THAT(infos[3], HasType(HighlightingType::Type));
+}
+
TEST_F(HighlightingInformations, NameSpaceReference)
{
const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(166, 35));
@@ -469,6 +476,13 @@ TEST_F(HighlightingInformations, NameSpaceReference)
ASSERT_THAT(infos[0], HasType(HighlightingType::Type));
}
+TEST_F(HighlightingInformations, StructInNameSpaceReference)
+{
+ const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(166, 35));
+
+ ASSERT_THAT(infos[2], HasType(HighlightingType::Type));
+}
+
TEST_F(HighlightingInformations, VirtualFunction)
{
const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(170, 35));