Skip to content

Commit

Permalink
Fix compare char with string literal in for (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
ladisgin authored Dec 14, 2023
1 parent d2228aa commit f366873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/src/visitors/AbstractValueViewVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ namespace visitor {
visitArrayElementAfter(newType, newName, newView, newAccess, depth + 1);
}
}

void AbstractValueViewVisitor::visitCString(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
Expand Down
8 changes: 5 additions & 3 deletions server/src/visitors/ParametrizedAssertsVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace visitor {
PrinterUtils::ACTUAL, functionCall, std::nullopt, true,
additionalPointersCount);
printer->strDeclareVar(type.typeName(),
PrinterUtils::fillVarName(access, PrinterUtils::EXPECTED), value);
PrinterUtils::fillVarName(access, PrinterUtils::EXPECTED), value);
} else {
printer->ss << value << NL;
}
Expand All @@ -110,7 +110,8 @@ namespace visitor {
additionalPointersCount);
const auto &gtestMacro = predicateMapping.at(predicate);
auto signature =
processExpect(type, gtestMacro, {view->getEntryValue(printer), getDecorateActualVarName(access)});
processExpect(type, gtestMacro,
{view->getEntryValue(printer), getDecorateActualVarName(access)});
signature = changeSignatureToNullCheck(signature, type, view, access);
printer->strFunctionCall(signature.name, signature.args, SCNL, std::nullopt, true,
0, std::nullopt, inUnion);
Expand All @@ -121,7 +122,8 @@ namespace visitor {
}
const auto &gtestMacro = predicateMapping.at(predicate);
auto signature = processExpect(type, gtestMacro,
{getDecorateActualVarName(access), view->getEntryValue(printer)});
{getDecorateActualVarName(access),
PrinterUtils::fillVarName(access, PrinterUtils::EXPECTED)});
signature = changeSignatureToNullCheck(signature, type, view, access);
printer->strFunctionCall(signature.name, signature.args, SCNL, std::nullopt, true, 0,
std::nullopt, inUnion);
Expand Down

0 comments on commit f366873

Please sign in to comment.