Skip to content

Commit

Permalink
Don't create return value for ERROR suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Kalugin committed Feb 2, 2023
1 parent b3f33dd commit 4b22e1a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions server/src/visitors/ParametrizedAssertsVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ namespace visitor {
auto returnType = methodDescription.returnType.maybeReturnArray()
? methodDescription.returnType.arrayClone(usage, pointerSize)
: methodDescription.returnType;

functionCall = printer->constrVisitorFunctionCall(methodDescription, testCase, false, errorMode);
if (testCase.returnValue.view->getEntryValue(nullptr) == PrinterUtils::C_NULL) {
additionalPointersCount = methodDescription.returnType.countReturnPointers(true);
printer->writeCodeLine(
StringUtils::stringFormat("EXPECT_TRUE(%s)",
PrinterUtils::getEqualString(functionCall, PrinterUtils::C_NULL)));
return;
if (!types::TypesHandler::skipTypeInReturn(methodDescription.returnType) && !testCase.isError()) {
if (testCase.returnValue.view->getEntryValue(nullptr) == PrinterUtils::C_NULL) {
additionalPointersCount = methodDescription.returnType.countReturnPointers(true);
printer->writeCodeLine(
StringUtils::stringFormat("EXPECT_TRUE(%s)",
PrinterUtils::getEqualString(functionCall, PrinterUtils::C_NULL)));
return;
} else {
additionalPointersCount = 0;
visitAny(returnType, "", testCase.returnValue.view.get(), PrinterUtils::DEFAULT_ACCESS, 0);
functionCall = {};
additionalPointersCount = 0;
}
} else {
additionalPointersCount = 0;
printer->writeCodeLine(functionCall);
return;
}
visitAny(returnType, "", testCase.returnValue.view.get(), PrinterUtils::DEFAULT_ACCESS, 0);
functionCall = {};
additionalPointersCount = 0;
}

void ParametrizedAssertsVisitor::visitArray(const types::Type &type,
Expand Down

0 comments on commit 4b22e1a

Please sign in to comment.