diff --git a/server/src/NameDecorator.cpp b/server/src/NameDecorator.cpp index 79a7361c8..3784bf5f2 100644 --- a/server/src/NameDecorator.cpp +++ b/server/src/NameDecorator.cpp @@ -75,7 +75,7 @@ const std::unordered_set NameDecorator::CPP_KEYWORDS = { "explicit", "export", "extern", - "false", +// "false", "float", "for", "friend", @@ -115,7 +115,7 @@ const std::unordered_set NameDecorator::CPP_KEYWORDS = { "this", "thread_local", "throw", - "true", +// "true", "try", "typedef", "typeid", diff --git a/server/src/Tests.h b/server/src/Tests.h index 4ebd9a4e4..b1f68d4af 100644 --- a/server/src/Tests.h +++ b/server/src/Tests.h @@ -294,7 +294,7 @@ namespace tests { if (structInfo.fields[i].name.empty()) return ""; - std::string prefix = "." + structInfo.fields[i].name + " = "; + std::string prefix = "." + NameDecorator::decorate(structInfo.fields[i].name) + " = "; if (structInfo.isCLike) { return prefix; } diff --git a/server/src/visitors/AssertsVisitor.cpp b/server/src/visitors/AssertsVisitor.cpp index 291a27fb7..267a1ce0a 100644 --- a/server/src/visitors/AssertsVisitor.cpp +++ b/server/src/visitors/AssertsVisitor.cpp @@ -39,6 +39,9 @@ namespace visitor { macroName = PrinterUtils::EXPECT_DOUBLE_EQ; } } + std::for_each(args.begin(), args.end(), [&type](std::string &arg) { + arg = NameDecorator::decorate(arg); + }); return VerboseAssertsVisitor::FunctionSignature{ macroName, std::move(args) }; } diff --git a/server/src/visitors/ParametrizedAssertsVisitor.cpp b/server/src/visitors/ParametrizedAssertsVisitor.cpp index 40db14f6b..797f684d1 100644 --- a/server/src/visitors/ParametrizedAssertsVisitor.cpp +++ b/server/src/visitors/ParametrizedAssertsVisitor.cpp @@ -78,9 +78,7 @@ namespace visitor { printer->strDeclareVar( type.typeName(), PrinterUtils::fillVarName(access, PrinterUtils::EXPECTED), value); } - else { - printer->ss << value << NL; - } + AbstractValueViewVisitor::visitStruct(type, name, view, access, depth); } void ParametrizedAssertsVisitor::visitPrimitive(const types::Type &type,