use of org.evosuite.testcase.PrimitiveExpression.Operator in project evosuite by EvoSuite.
the class TestExtractingVisitor method retrieveVariableReference.
private VariableReference retrieveVariableReference(InfixExpression infixExpr, Class<?> exprType) {
if (exprType == null) {
exprType = retrieveTypeClass(infixExpr);
}
VariableReference ref = new VariableReferenceImpl(testCase.getReference(), exprType);
VariableReference leftOperand = retrieveVariableReference(infixExpr.getLeftOperand(), null);
leftOperand.setOriginalCode(infixExpr.getLeftOperand().toString());
Operator operator = Operator.toOperator(infixExpr.getOperator().toString());
VariableReference rightOperand = retrieveVariableReference(infixExpr.getRightOperand(), null);
rightOperand.setOriginalCode(infixExpr.getRightOperand().toString());
PrimitiveExpression expr = new PrimitiveExpression(testCase.getReference(), ref, leftOperand, operator, rightOperand);
testCase.addStatement(expr);
return ref;
}
Aggregations