From b746a3e562d53c07ad90a98093b60fa25f6f33b8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 18 Mar 2021 11:13:17 +0100 Subject: [PATCH] Unittest: Fix expectations Amends 5fcd52fe834108cb134. Change-Id: I68ce291176ab8e095b09ae6f0d64d2564e52cf0f Reviewed-by: David Schulz --- tests/unit/unittest/gtest-creator-printing.cpp | 1 + tests/unit/unittest/tokenprocessor-test.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/unit/unittest/gtest-creator-printing.cpp b/tests/unit/unittest/gtest-creator-printing.cpp index cc10dcfa9df..cdb6b188083 100644 --- a/tests/unit/unittest/gtest-creator-printing.cpp +++ b/tests/unit/unittest/gtest-creator-printing.cpp @@ -835,6 +835,7 @@ static const char *highlightingTypeToCStringLiteral(HighlightingType type) RETURN_TEXT_FOR_CASE(VirtualFunction); RETURN_TEXT_FOR_CASE(Type); RETURN_TEXT_FOR_CASE(LocalVariable); + RETURN_TEXT_FOR_CASE(Parameter); RETURN_TEXT_FOR_CASE(GlobalVariable); RETURN_TEXT_FOR_CASE(Field); RETURN_TEXT_FOR_CASE(Enumeration); diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index 94e1b83b152..04ddaa93179 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -354,14 +354,14 @@ TEST_F(TokenProcessor, LocalVariableFunctionArgumentDeclaration) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(84, 45)); - ASSERT_THAT(infos[5], IsHighlightingMark(84u, 41u, 3u, HighlightingType::LocalVariable)); + ASSERT_THAT(infos[5], IsHighlightingMark(84u, 41u, 3u, HighlightingType::Parameter)); } TEST_F(TokenProcessor, LocalVariableFunctionArgumentReference) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(86, 26)); - ASSERT_THAT(infos[0], IsHighlightingMark(86u, 5u, 3u, HighlightingType::LocalVariable)); + ASSERT_THAT(infos[0], IsHighlightingMark(86u, 5u, 3u, HighlightingType::Parameter)); } TEST_F(TokenProcessor, ClassVariableDeclaration) @@ -1208,7 +1208,7 @@ TEST_F(TokenProcessor, FriendArgumentDeclaration) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(351, 65)); - ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::LocalVariable)); + ASSERT_THAT(infos[8], HasOnlyType(HighlightingType::Parameter)); } TEST_F(TokenProcessor, FieldInitialization) @@ -1396,7 +1396,7 @@ TEST_F(TokenProcessor, NonConstReferenceArgumentFromFunctionParameter) infos[1]; ASSERT_THAT(infos[2], - HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument)); + HasTwoTypes(HighlightingType::Parameter, HighlightingType::OutputArgument)); } TEST_F(TokenProcessor, NonConstPointerArgumentAsExpression) @@ -1497,7 +1497,7 @@ TEST_F(TokenProcessor, VariableInOperatorFunctionCall) { const auto infos = translationUnit.tokenInfosInRange(sourceRange(566, 12)); - ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::LocalVariable)); + ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::Parameter)); } TEST_F(TokenProcessor, UsingTemplateFunction)