| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | /****************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Copyright (C) 2016 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "googletest.h"
 | 
					
						
							| 
									
										
										
										
											2019-04-24 14:07:39 +02:00
										 |  |  | #include "unittest-utility-functions.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <clangdocument.h>
 | 
					
						
							|  |  |  | #include <clangdocuments.h>
 | 
					
						
							|  |  |  | #include <clangtranslationunit.h>
 | 
					
						
							|  |  |  | #include <cursor.h>
 | 
					
						
							|  |  |  | #include <clangsupport_global.h>
 | 
					
						
							|  |  |  | #include <clangstring.h>
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | #include <fulltokeninfo.h>
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | #include <sourcelocation.h>
 | 
					
						
							|  |  |  | #include <sourcerange.h>
 | 
					
						
							|  |  |  | #include <tokeninfo.h>
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | #include <tokenprocessor.h>
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | #include <unsavedfiles.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <clang-c/Index.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using ClangBackEnd::Cursor; | 
					
						
							|  |  |  | using ClangBackEnd::HighlightingTypes; | 
					
						
							|  |  |  | using ClangBackEnd::TokenInfo; | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | using ClangBackEnd::TokenProcessor; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | using ClangBackEnd::HighlightingType; | 
					
						
							|  |  |  | using ClangBackEnd::Document; | 
					
						
							|  |  |  | using ClangBackEnd::Documents; | 
					
						
							|  |  |  | using ClangBackEnd::TranslationUnit; | 
					
						
							|  |  |  | using ClangBackEnd::UnsavedFiles; | 
					
						
							|  |  |  | using ClangBackEnd::ClangString; | 
					
						
							|  |  |  | using ClangBackEnd::SourceRange; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using testing::PrintToString; | 
					
						
							|  |  |  | using testing::IsNull; | 
					
						
							|  |  |  | using testing::NotNull; | 
					
						
							|  |  |  | using testing::Gt; | 
					
						
							|  |  |  | using testing::Contains; | 
					
						
							|  |  |  | using testing::ElementsAre; | 
					
						
							|  |  |  | using testing::_; | 
					
						
							|  |  |  | using testing::EndsWith; | 
					
						
							|  |  |  | using testing::AllOf; | 
					
						
							|  |  |  | using testing::Not; | 
					
						
							|  |  |  | using testing::IsEmpty; | 
					
						
							|  |  |  | using testing::SizeIs; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P4(IsHighlightingMark, line, column, length, type, | 
					
						
							|  |  |  |            std::string(negation ? "isn't " : "is ") | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |            + PrintToString(line) + ", " | 
					
						
							|  |  |  |            + PrintToString(column) + ", " | 
					
						
							|  |  |  |            + PrintToString(length) + ", " | 
					
						
							|  |  |  |            + PrintToString(type) + ", " | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |            ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     return arg.line() == line && arg.column() == column && arg.length() == length | 
					
						
							|  |  |  |             && arg.types().mainHighlightingType == type; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P(HasOnlyType, type, | 
					
						
							|  |  |  |           std::string(negation ? "isn't " : "is ") | 
					
						
							|  |  |  |           + PrintToString(type) | 
					
						
							|  |  |  |           ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return arg.hasOnlyType(type); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P2(HasTwoTypes, firstType, secondType, | 
					
						
							|  |  |  |            std::string(negation ? "isn't " : "is ") | 
					
						
							|  |  |  |            + PrintToString(firstType) | 
					
						
							|  |  |  |            + " and " | 
					
						
							|  |  |  |            + PrintToString(secondType) | 
					
						
							|  |  |  |            ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return arg.hasMainType(firstType) && arg.hasMixinTypeAt(0, secondType) && arg.mixinSize() == 1; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P3(HasThreeTypes, firstType, secondType, thirdType, | 
					
						
							|  |  |  |            std::string(negation ? "isn't " : "is ") | 
					
						
							|  |  |  |            + PrintToString(firstType) | 
					
						
							|  |  |  |            + ", " | 
					
						
							|  |  |  |            + PrintToString(secondType) | 
					
						
							|  |  |  |            + " and " | 
					
						
							|  |  |  |            + PrintToString(thirdType) | 
					
						
							|  |  |  |            ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return arg.hasMainType(firstType) && arg.hasMixinTypeAt(0, secondType) && arg.hasMixinTypeAt(1, thirdType) && arg.mixinSize() == 2; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P(HasMixin, mixinType, | 
					
						
							|  |  |  |           std::string(negation ? "isn't " : "is ") | 
					
						
							|  |  |  |           + PrintToString(mixinType) | 
					
						
							|  |  |  |           ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return arg.hasMixinType(mixinType); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct Data { | 
					
						
							|  |  |  |     Data() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         document.parse(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::UnsavedFiles unsavedFiles; | 
					
						
							| 
									
										
										
										
											2018-09-25 09:41:32 +02:00
										 |  |  |     ClangBackEnd::Documents documents{unsavedFiles}; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     Utf8String filePath{Utf8StringLiteral(TESTDATA_DIR"/highlightingmarks.cpp")}; | 
					
						
							|  |  |  |     Document document{filePath, | 
					
						
							| 
									
										
										
										
											2019-04-24 14:07:39 +02:00
										 |  |  |                       UnitTest::addPlatformArguments( | 
					
						
							| 
									
										
										
										
											2018-09-25 09:41:32 +02:00
										 |  |  |                           {Utf8StringLiteral("-std=c++14"), | 
					
						
							|  |  |  |                            Utf8StringLiteral("-I" TESTDATA_DIR)}), | 
					
						
							| 
									
										
										
										
											2018-10-19 10:20:27 +02:00
										 |  |  |                       {}, | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |                       documents}; | 
					
						
							|  |  |  |     TranslationUnit translationUnit{filePath, | 
					
						
							|  |  |  |                                     filePath, | 
					
						
							|  |  |  |                                     document.translationUnit().cxIndex(), | 
					
						
							|  |  |  |                                     document.translationUnit().cxTranslationUnit()}; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | class TokenProcessor : public ::testing::Test | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     static void SetUpTestCase(); | 
					
						
							|  |  |  |     static void TearDownTestCase(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     SourceRange sourceRange(uint line, uint columnEnd) const; | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  |     SourceRange sourceRangeMultiLine(uint firstLine, uint lastLine, uint columnEnd) const; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |     static Data *d; | 
					
						
							|  |  |  |     const TranslationUnit &translationUnit = d->translationUnit; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, CreateNullInformations) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  |     ::TokenProcessor<TokenInfo> infos; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_TRUE(infos.isNull()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NullInformationsAreEmpty) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  |     ::TokenProcessor<TokenInfo> infos; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_TRUE(infos.isEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IsNotNull) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(aRange); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_FALSE(infos.isNull()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IteratorBeginEnd) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto aRange = translationUnit.sourceRange(3, 1, 5, 1); | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(aRange); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const auto endIterator = std::next(infos.begin(), infos.size()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos.end(), endIterator); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ForFullTranslationUnitRange) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfos(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos, AllOf(Contains(IsHighlightingMark(1u, 1u, 4u, HighlightingType::Keyword)), | 
					
						
							|  |  |  |                              Contains(IsHighlightingMark(277u, 5u, 15u, HighlightingType::Function)))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, Size) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto range = translationUnit.sourceRange(5, 5, 5, 10); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(range); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos.size(), 1); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_Keyword) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(5, 12)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(5u, 5u, 6u, HighlightingType::Keyword)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StringLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(1, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], IsHighlightingMark(1u, 24u, 10u, HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, Utf8StringLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(2, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], IsHighlightingMark(2u, 24u, 12u, HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, RawStringLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(3, 34)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], IsHighlightingMark(3u, 24u, 13u, HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, CharacterLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(4, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], IsHighlightingMark(4u, 24u, 3u, HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IntegerLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(23, 26)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], IsHighlightingMark(23u, 24u, 1u, HighlightingType::NumberLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FloatLiteral) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(24, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], IsHighlightingMark(24u, 24u, 4u, HighlightingType::NumberLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FunctionDefinition) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(45, 20)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Function, HighlightingType::Declaration, HighlightingType::FunctionDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, MemberFunctionDefinition) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(52, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Function, HighlightingType::Declaration, HighlightingType::FunctionDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, VirtualMemberFunctionDefinitionOutsideOfClassBody) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(586, 37)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::VirtualFunction, HighlightingType::Declaration, HighlightingType::FunctionDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, VirtualMemberFunctionDefinitionInsideOfClassBody) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(589, 47)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::VirtualFunction, HighlightingType::Declaration, HighlightingType::FunctionDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FunctionDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(55, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, MemberFunctionDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(59, 27)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, MemberFunctionReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(104, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(104u, 9u, 23u, HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FunctionCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(64, 16)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeConversionFunction) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(68, 20)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], IsHighlightingMark(68u, 14u, 3u, HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, InbuiltTypeConversionFunction) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(69, 20)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], IsHighlightingMark(69u, 14u, 3u, HighlightingType::PrimitiveType)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(74, 13)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(74u, 5u, 3u, HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, LocalVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(79, 13)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], IsHighlightingMark(79u, 9u, 3u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, LocalVariableDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(79, 13)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], IsHighlightingMark(79u, 9u, 3u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, LocalVariableReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(81, 26)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(81u, 5u, 3u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 16:37:51 +01:00
										 |  |  | TEST_F(TokenProcessor, ParameterFunctionArgumentDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(84, 45)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |     ASSERT_THAT(infos[5], IsHighlightingMark(84u, 41u, 3u, HighlightingType::Parameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 16:37:51 +01:00
										 |  |  | TEST_F(TokenProcessor, ParameterFunctionArgumentReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(86, 26)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(86u, 5u, 3u, HighlightingType::Parameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassVariableDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(90, 21)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], IsHighlightingMark(90u, 9u, 11u, HighlightingType::Field)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassVariableReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(94, 23)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], IsHighlightingMark(94u, 9u, 11u, HighlightingType::Field)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StaticMethodDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(110, 25)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StaticMethodReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(114, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, Enumeration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(118, 17)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Enum)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, Enumerator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(120, 15)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Enumeration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumerationReferenceDeclarationType) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(125, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Enum)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumerationReferenceDeclarationVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(125, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumerationReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(127, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumeratorReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(127, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Enumeration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassForwardDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(130, 12)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ConstructorDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(134, 13)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DestructorDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(135, 15)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Function, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassForwardDeclarationReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(138, 23)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassTypeReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(140, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ConstructorReferenceVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(140, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, UnionDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(145, 12)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Union)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, UnionDeclarationReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(150, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Union)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, GlobalVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(150, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::GlobalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StructDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(50, 11)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Struct)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NameSpace) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(160, 22)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Namespace)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NameSpaceAlias) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(164, 38)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Type, HighlightingType::Namespace)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, UsingStructInNameSpace) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(165, 36)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NameSpaceReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(166, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Namespace)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StructInNameSpaceReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(166, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, HighlightingType::Struct)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, VirtualFunctionDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(170, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::VirtualFunction, HighlightingType::Declaration)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_NonVirtualFunctionCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(177, 46)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_NonVirtualFunctionCallPointer) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(180, 54)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, VirtualFunctionCallPointer) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(192, 51)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::VirtualFunction)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FinalVirtualFunctionCallPointer) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(202, 61)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonFinalVirtualFunctionCallPointer) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(207, 61)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::VirtualFunction)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | TEST_F(TokenProcessor, OverriddenPlusOperatorDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(220, 67)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CallToOverriddenPlusOperator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(224, 49)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[6], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | TEST_F(TokenProcessor, CallToOverriddenPlusAssignOperator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(226, 24)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, OverriddenStarOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(604, 26)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, OverriddenStarOperatorNonMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, IntegerCallToOverriddenBinaryOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(613, 9)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, FloatCallToOverriddenBinaryOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(614, 9)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, LeftShiftAssignmentOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(618, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledLeftShiftAssignmentOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(629, 18)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::NumberLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, FunctionCallOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(619, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledFunctionCallOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(632, 16)); | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, AccessOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(620, 38)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledAccessOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(633, 16)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, NewOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(621, 39)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledNewOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(635, 34)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation));  // = is not marked.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     // CLANG-UPGRADE-CHECK: Check if 'new' keyword usage cursor correctly returns referenced() cursor
 | 
					
						
							|  |  |  |     // and uncomment this test in that case.
 | 
					
						
							|  |  |  |     // ASSERT_THAT(infos[4], HasTwoTypes(HighlightingType::Keyword, HighlightingType::OverloadedOperator));  // new
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, DeleteOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(622, 37)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // delete
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledDeleteOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(636, 20)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // CLANG-UPGRADE-CHECK: Check if 'delete' keyword usage cursor correctly returns referenced() cursor
 | 
					
						
							|  |  |  |     // and uncomment this test in that case.
 | 
					
						
							|  |  |  |     // ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Keyword, HighlightingType::OverloadedOperator));  // delete
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Punctuation));  // ; is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, NewArrayOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(623, 41)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // new
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // [
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // ]
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledNewArrayOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(637, 34)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation));  // = is not marked.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     // CLANG-UPGRADE-CHECK: Check if 'new' keyword usage cursor correctly returns referenced() cursor
 | 
					
						
							|  |  |  |     // and uncomment this test in that case.
 | 
					
						
							|  |  |  |     // ASSERT_THAT(infos[4], HasTwoTypes(HighlightingType::Keyword, HighlightingType::OverloadedOperator));  // new
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, DeleteArrayOperatorMemberDefinition) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(624, 39)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // delete
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // [
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator));  // ]
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation));  // ( is a punctuation.
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledDeleteArrayOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(638, 20)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // CLANG-UPGRADE-CHECK: Check if 'delete' keyword usage cursor correctly returns referenced() cursor
 | 
					
						
							|  |  |  |     // and uncomment this test in that case.
 | 
					
						
							|  |  |  |     // ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Keyword, HighlightingType::OverloadedOperator));  // delete
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledNotOverloadedOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(634, 22)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Keyword)); // new
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, ParenthesisOperatorWithoutArguments) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(654, 25)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // operator
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '('
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // ')'
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Punctuation)); // second '(' is a punctuation
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledParenthesisOperatorWithoutArguments) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(662, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '('
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // ')'
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, OperatorWithOnePunctuationTokenWithoutArguments) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(655, 25)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // operator
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '*'
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation)); // ( is a punctuation
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledOperatorWithOnePunctuationTokenWithoutArguments) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(663, 13)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[0], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '*'
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, EqualsOperatorOverload) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(656, 43)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Keyword, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // operator
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '='
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation)); // ( is a punctuation
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CalledEqualsOperatorOverload) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(664, 23)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, HighlightingType::OverloadedOperator)); // '='
 | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, LeftParenthesisIsAPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, SeparatingCommaIsAPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, RightParenthesisIsAPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[7], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CurlyLeftParenthesisIsAPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, CurlyRightParenthesisIsAPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(607, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | TEST_F(TokenProcessor, OperatorColon) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(668, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-10 17:49:04 +01:00
										 |  |  |     ASSERT_THAT(infos[6], HasThreeTypes(HighlightingType::Punctuation, HighlightingType::Operator, | 
					
						
							|  |  |  |                                         HighlightingType::TernaryElse)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, PunctuationColon) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(133, 10)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, LessThanOperator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(668, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Punctuation, HighlightingType::Operator)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, LessThanPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2020-10-15 12:06:14 +02:00
										 |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(247, 10)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-15 12:06:14 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Punctuation, | 
					
						
							|  |  |  |                                       HighlightingType::AngleBracketOpen)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, GreaterThanPunctuation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(247, 19)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-15 12:06:14 +02:00
										 |  |  |     ASSERT_THAT(infos[4], HasTwoTypes(HighlightingType::Punctuation, | 
					
						
							|  |  |  |                                       HighlightingType::AngleBracketClose)); | 
					
						
							| 
									
										
										
										
											2018-02-17 21:12:15 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, Comment) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(229, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Comment)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessingDirective) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(231, 37)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorMacroDefinition) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(231, 37)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::PreprocessorDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorFunctionMacroDefinition) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(232, 47)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::PreprocessorDefinition)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorMacroExpansion) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(236, 27)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorMacroExpansionArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(236, 27)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::NumberLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorInclusionDirective) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(239, 18)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-30 12:28:37 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::StringLiteral)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, GotoLabelStatement) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(242, 12)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Label)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, GotoLabelStatementReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(244, 21)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Label)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(254, 25)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTypeParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 10:51:33 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasTwoTypes(HighlightingType::Type, | 
					
						
							|  |  |  |                                       HighlightingType::TemplateTypeParameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateDefaultParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[5], HasTwoTypes(HighlightingType::Type, HighlightingType::Struct)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonTypeTemplateParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonTypeTemplateParameterDefaultArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::NumberLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTemplateParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 10:51:33 +02:00
										 |  |  |     ASSERT_THAT(infos[17], HasTwoTypes(HighlightingType::Type, | 
					
						
							|  |  |  |                                        HighlightingType::TemplateTemplateParameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTemplateParameterDefaultArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(265, 135)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[19], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateFunctionDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(266, 63)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Function, HighlightingType::Declaration, HighlightingType::FunctionDefinition)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTypeParameterReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(268, 58)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 10:51:33 +02:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, | 
					
						
							|  |  |  |                                       HighlightingType::TemplateTypeParameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTypeParameterDeclarationReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(268, 58)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonTypeTemplateParameterReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(269, 71)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonTypeTemplateParameterReferenceReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(269, 71)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTemplateParameterReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(270, 89)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 10:51:33 +02:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, | 
					
						
							|  |  |  |                                       HighlightingType::TemplateTemplateParameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTemplateContainerParameterReference) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(270, 89)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-11 10:51:33 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, | 
					
						
							|  |  |  |                                       HighlightingType::TemplateTypeParameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateTemplateParameterReferenceVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(270, 89)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassFinalVirtualFunctionCallPointer) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(212, 61)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassFinalVirtualFunctionCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(277, 23)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, HasFunctionArguments) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(286, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_TRUE(infos[1].hasFunctionArguments()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorInclusionDirectiveWithAngleBrackets ) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(289, 38)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-30 12:28:37 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ArgumentInMacroExpansionIsKeyword) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(302, 36)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::PrimitiveType)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_FirstArgumentInMacroExpansionIsLocalVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(302, 36)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_SecondArgumentInMacroExpansionIsLocalVariable) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(302, 36)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_SecondArgumentInMacroExpansionIsField) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(310, 40)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumerationType) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(316, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Enum)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeInStaticCast) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(328, 64)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, StaticCastIsKeyword) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(328, 64)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Keyword)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  | TEST_F(TokenProcessor, StaticCastPunctation) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(328, 64)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-15 12:06:14 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Punctuation, | 
					
						
							|  |  |  |                                       HighlightingType::AngleBracketOpen)); | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeInReinterpretCast) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(329, 69)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IntegerAliasDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(333, 41)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IntegerAlias) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(341, 31)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, SecondIntegerAlias) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(342, 43)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, IntegerTypedef) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(343, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Typedef)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FunctionAlias) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(344, 16)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FriendTypeDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(350, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FriendArgumentTypeDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(351, 65)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[6], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FriendArgumentDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(351, 65)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |     ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::Parameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, FieldInitialization) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(358, 18)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Field)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateFunctionCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(372, 29)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplatedType) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(377, 21)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[1], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplatedTypeDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(384, 49)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NoOperator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(389, 24)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ScopeOperator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(400, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateClassNamespace) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(413, 78)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Namespace)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateClass) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(413, 78)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateClassParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(413, 78)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[4], HasTwoTypes(HighlightingType::Type, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateClassDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(413, 78)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[6], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeDefDeclaration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(418, 36)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasTwoTypes(HighlightingType::Type, HighlightingType::Typedef)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, TypeDefDeclarationUsage) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(419, 48)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::Typedef)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstReferenceArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(455, 35)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ConstReferenceArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(464, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							|  |  |  |                 HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, RValueReferenceArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(473, 52)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[8], | 
					
						
							|  |  |  |                 HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstPointerArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(482, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							| 
									
										
										
										
											2020-10-14 14:12:30 +02:00
										 |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PointerToConstArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(490, 31)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							|  |  |  |                 HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ConstPointerArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(491, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							| 
									
										
										
										
											2020-10-14 14:12:30 +02:00
										 |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstPointerGetterAsArgument) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(580, 42)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2] ,HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[6], HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[7], Not(HasMixin(HighlightingType::OutputArgument))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstReferenceArgumentCallInsideCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(501, 64)); | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[3]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[7], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, OutputArgumentsAreEmptyAfterIteration) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(501, 63)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for (const auto &info : infos ) { Q_UNUSED(info) } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_TRUE(infos.currentOutputArgumentRangesAreEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstReferenceArgumentFromFunctionParameter) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(506, 42)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |                 HasTwoTypes(HighlightingType::Parameter, HighlightingType::OutputArgument)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstPointerArgumentAsExpression) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(513, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], | 
					
						
							| 
									
										
										
										
											2020-10-14 14:12:30 +02:00
										 |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstPointerArgumentAsInstanceWithMember) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(525, 46)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstPointerArgumentAsMemberOfInstance) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(525, 46)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  |     infos[2]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::Field, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_NonConstReferenceArgumentConstructor) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(540, 57)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[2]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_NonConstReferenceMemberInitialization) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(546, 19)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[2]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], | 
					
						
							|  |  |  |                 HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, EnumerationTypeDef) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(424, 41)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[3], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Enum)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // QTCREATORBUG-15473
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DISABLED_ArgumentToUserDefinedIndexOperator) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(434, 19)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, ClassTemplateParticalSpecialization) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(553, 33)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ASSERT_THAT(infos[6], HasThreeTypes(HighlightingType::Type, HighlightingType::Declaration, HighlightingType::Class)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, UsingFunction) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(556, 27)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorIfDirective) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(558, 6)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, PreprocessorInclusionDirectiveWithKeyword) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(561, 15)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-24 09:46:38 +02:00
										 |  |  | TEST_F(TokenProcessor, VariableInOperatorFunctionCall) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(566, 12)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Parameter)); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, UsingTemplateFunction) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(584, 17)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, HeaderNameIsInclusion) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(239, 31)); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[2]); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.includeDirectivePath, true); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, HeaderNameIsInclusionWithAngleBrackets) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(289, 31)); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[2]); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.includeDirectivePath, true); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NotInclusion) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(241, 13)); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[1]); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.includeDirectivePath, false); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, MacroIsIdentifier) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(232, 30)); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[2]); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.identifier, true); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, DefineIsNotIdentifier) | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(232, 30)); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[1]); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.includeDirectivePath, false); | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | TEST_F(TokenProcessor, NamespaceTypeSpelling) | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(592, 59)); | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |     ClangBackEnd::TokenInfoContainer container(infos[10]); | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.semanticParentTypeSpelling, Utf8StringLiteral("NFoo::NBar::NTest")); | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-04 14:50:10 +02:00
										 |  |  | TEST_F(TokenProcessor, TypeNameOfInvalidDeclarationIsInvalid) | 
					
						
							| 
									
										
										
										
											2017-11-15 13:35:38 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(594, 14)); | 
					
						
							| 
									
										
										
										
											2017-11-15 13:35:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-04 14:50:10 +02:00
										 |  |  | TEST_F(TokenProcessor, VariableNameOfInvalidDeclarationIsInvalid) | 
					
						
							| 
									
										
										
										
											2017-11-15 13:35:38 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(594, 14)); | 
					
						
							| 
									
										
										
										
											2017-11-15 13:35:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyName) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(599, 103)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-23 12:06:12 +02:00
										 |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  |     ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::QtProperty)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyNameMultiLine) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRangeMultiLine(704, 732, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::QtProperty)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyFunction) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(599, 103)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyFunctionMultiLine) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRangeMultiLine(704, 732, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyInternalKeyword) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(599, 103)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyInternalKeywordMultiLine) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRangeMultiLine(704, 732, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Invalid)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyLastToken) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(599, 103)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[14], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyLastTokenMultiLine) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRangeMultiLine(704, 732, 14)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[14], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  | TEST_F(TokenProcessor, QtPropertyType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(600, 46)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | TEST_F(TokenProcessor, CursorRange) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(592, 15)); | 
					
						
							|  |  |  |     const auto expectedRange = translationUnit.sourceRange(592, 1, 592, 87); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::TokenInfoContainer container(infos[1]); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     ASSERT_THAT(container.extraInfo.cursorRange, expectedRange); | 
					
						
							| 
									
										
										
										
											2018-02-07 13:59:06 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 14:07:35 +02:00
										 |  |  | TEST_F(TokenProcessor, AnonymousEnum) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(641, 7)); | 
					
						
							| 
									
										
										
										
											2018-04-06 14:07:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::TokenInfoContainer container(infos[0]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mainHighlightingType, ClangBackEnd::HighlightingType::Keyword); | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mixinHighlightingTypes[0], ClangBackEnd::HighlightingType::Enum); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, AnonymousNamespace) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(645, 12)); | 
					
						
							| 
									
										
										
										
											2018-04-06 14:07:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::TokenInfoContainer container(infos[0]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mainHighlightingType, ClangBackEnd::HighlightingType::Keyword); | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mixinHighlightingTypes[0], ClangBackEnd::HighlightingType::Namespace); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, AnonymousStruct) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2016-11-05 15:29:10 +01:00
										 |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(647, 13)); | 
					
						
							| 
									
										
										
										
											2018-04-06 14:07:35 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::TokenInfoContainer container(infos[0]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mainHighlightingType, ClangBackEnd::HighlightingType::Keyword); | 
					
						
							|  |  |  |     ASSERT_THAT(container.types.mixinHighlightingTypes[0], ClangBackEnd::HighlightingType::Struct); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 14:24:28 +02:00
										 |  |  | TEST_F(TokenProcessor, LexicalParentIndex) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto containers = translationUnit.fullTokenInfosInRange( | 
					
						
							|  |  |  |                 translationUnit.sourceRange(50, 1, 53, 3)).toTokenInfoContainers(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |     ASSERT_THAT(containers[4].extraInfo.lexicalParentIndex, 1); | 
					
						
							| 
									
										
										
										
											2018-04-06 14:24:28 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-23 12:06:12 +02:00
										 |  |  | TEST_F(TokenProcessor, QtOldStyleSignal) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(672, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, QtOldStyleSlot) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(673, 30)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, QtOldStyleSignalFunctionPointerType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.fullTokenInfosInRange(sourceRange(674, 50)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasOnlyType(HighlightingType::PreprocessorExpansion)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Function)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[7], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::Type)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-22 14:37:51 +01:00
										 |  |  | TEST_F(TokenProcessor, NonConstParameterConstructor) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(681, 90)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[1]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], Not(HasMixin(HighlightingType::OutputArgument))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, DISABLED_NonConstArgumentConstructor) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(686, 47)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     infos[2]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-05 12:51:30 +01:00
										 |  |  | TEST_F(TokenProcessor, LambdaLocalVariableCapture) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(442, 47)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-12 13:55:51 +01:00
										 |  |  | 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); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-08 15:48:52 +02:00
										 |  |  | TEST_F(TokenProcessor, TemplateAlias) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(701, 8)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[0], HasTwoTypes(HighlightingType::Type, HighlightingType::TypeAlias)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-23 16:37:59 +02:00
										 |  |  | TEST_F(TokenProcessor, StructuredBinding) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(737, 23)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], IsHighlightingMark(737u, 17u, 1u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], IsHighlightingMark(737u, 20u, 1u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 12:26:33 +01:00
										 |  |  | TEST_F(TokenProcessor, IndirectMacro) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(746, 32)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], IsHighlightingMark(746u, 20u, 10u, HighlightingType::LocalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 15:03:10 +01:00
										 |  |  | TEST_F(TokenProcessor, MultiDimArray) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(752, 28)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(infos[3], IsHighlightingMark(752u, 13u, 10u, HighlightingType::GlobalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-23 15:48:04 +01:00
										 |  |  | TEST_F(TokenProcessor, TemplateSeparateDeclDef) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRangeMultiLine(755, 771, 1)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[11], IsHighlightingMark(757u, 17u, 10u, HighlightingType::Invalid)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[37], IsHighlightingMark(764u, 5u, 9u, HighlightingType::GlobalVariable)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-18 16:14:05 +02:00
										 |  |  | TEST_F(TokenProcessor, NestedTemplateIncorrect) | 
					
						
							| 
									
										
										
										
											2021-04-15 13:54:02 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(773, 44)); | 
					
						
							| 
									
										
										
										
											2021-10-18 16:14:05 +02:00
										 |  |  |     ASSERT_THAT(infos[12], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							| 
									
										
										
										
											2021-04-15 13:54:02 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-16 15:38:52 +02:00
										 |  |  | TEST_F(TokenProcessor, OperatorInTemplate) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(787, 28)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-12 14:49:46 +02:00
										 |  |  | TEST_F(TokenProcessor, CyrillicString) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(792, 28)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], IsHighlightingMark(792u, 24u, 3u, HighlightingType::StringLiteral)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-14 11:28:29 +02:00
										 |  |  | TEST_F(TokenProcessor, PreProcessorInStruct) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-05-21 15:26:32 +02:00
										 |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(795, 14)); | 
					
						
							| 
									
										
										
										
											2021-05-14 11:28:29 +02:00
										 |  |  |     ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-18 16:14:05 +02:00
										 |  |  | TEST_F(TokenProcessor, DefinitionWithComparison) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(798, 39)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[13], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, GlobalVariableWithComparison) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(800, 18)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, VariableWithComparison) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(803, 22)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[5], HasOnlyType(HighlightingType::Punctuation)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(TokenProcessor, NestedTemplate) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     const auto infos = translationUnit.tokenInfosInRange(sourceRange(811, 44)); | 
					
						
							|  |  |  |     ASSERT_THAT(infos[12], HasTwoTypes(HighlightingType::Punctuation, | 
					
						
							|  |  |  |                                        HighlightingType::DoubleAngleBracketClose)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | Data *TokenProcessor::d; | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | void TokenProcessor::SetUpTestCase() | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     d = new Data; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | void TokenProcessor::TearDownTestCase() | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     delete d; | 
					
						
							|  |  |  |     d = nullptr; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-06 15:48:24 +01:00
										 |  |  | ClangBackEnd::SourceRange TokenProcessor::sourceRange(uint line, uint columnEnd) const | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     return translationUnit.sourceRange(line, 1, line, columnEnd); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-08 12:35:14 +02:00
										 |  |  | ClangBackEnd::SourceRange TokenProcessor::sourceRangeMultiLine(uint firstLine, uint lastLine, | 
					
						
							|  |  |  |                                                                uint columnEnd) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return translationUnit.sourceRange(firstLine, 1, lastLine, columnEnd); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-05 09:42:35 +01:00
										 |  |  | } |