summaryrefslogtreecommitdiff
path: root/tests/unit/unittest/clangquery-test.cpp
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2016-11-23 13:13:38 +0100
committerTim Jenssen <tim.jenssen@qt.io>2016-11-23 12:16:04 +0000
commit7f757884c5a04484820a97e592afae74beff95a9 (patch)
treed5066d8a24965523b5024ba37d210c74cd68446c /tests/unit/unittest/clangquery-test.cpp
parent52fc4a4ebdc840cc351a0ed465a6523d5bc53ac2 (diff)
downloadqt-creator-7f757884c5a04484820a97e592afae74beff95a9.tar.gz
Clang: Extend clang query
It's a first step to introduce clang query. Change-Id: I4d001a8883f56066765ce6bc561fa3f49611c0a4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'tests/unit/unittest/clangquery-test.cpp')
-rw-r--r--tests/unit/unittest/clangquery-test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/unittest/clangquery-test.cpp b/tests/unit/unittest/clangquery-test.cpp
index bfb47fc7fc..91947f4ae6 100644
--- a/tests/unit/unittest/clangquery-test.cpp
+++ b/tests/unit/unittest/clangquery-test.cpp
@@ -71,7 +71,7 @@ TEST_F(ClangQuery, RootSourceRangeForSimpleFunctionDeclarationRange)
simpleFunctionQuery.findLocations();
ASSERT_THAT(simpleFunctionQuery.takeSourceRanges().sourceRangeWithTextContainers().at(0),
- IsSourceRangeWithText(1, 1, 8, 1, "int function(int* pointer, int value) { if (pointer == nullptr) { return value + 1; } else { return value - 1; } }"));
+ IsSourceRangeWithText(1, 1, 8, 2, "int function(int* pointer, int value)\n{\n if (pointer == nullptr) {\n return value + 1;\n } else {\n return value - 1;\n }\n}"));
}
TEST_F(ClangQuery, RootSourceRangeForSimpleFieldDeclarationRange)
@@ -81,7 +81,7 @@ TEST_F(ClangQuery, RootSourceRangeForSimpleFieldDeclarationRange)
simpleClassQuery.findLocations();
ASSERT_THAT(simpleClassQuery.takeSourceRanges().sourceRangeWithTextContainers().at(0),
- IsSourceRangeWithText(4, 5, 4, 9, "int x"));
+ IsSourceRangeWithText(4, 5, 4, 10, " int x;"));
}
TEST_F(ClangQuery, NoSourceRangesForEmptyQuery)