Search in sources :

Example 21 with EvosuiteError

use of org.evosuite.testcase.execution.EvosuiteError in project evosuite by EvoSuite.

the class SymbolicObserver method after.

private void after(CharPrimitiveStatement statement, Scope scope) {
    char valueOf = statement.getValue();
    VariableReference varRef = statement.getReturnValue();
    String varRefName = varRef.getName();
    IntegerVariable integerVariable = buildIntegerVariable(varRefName, valueOf, Character.MIN_VALUE, Character.MAX_VALUE);
    symb_expressions.put(varRefName, integerVariable);
    Character character0;
    try {
        character0 = (Character) varRef.getObject(scope);
    } catch (CodeUnderTestException e) {
        throw new EvosuiteError(e);
    }
    ReferenceConstant charRef = newCharacterReference(character0, integerVariable);
    symb_references.put(varRefName, charRef);
}
Also used : ReferenceConstant(org.evosuite.symbolic.expr.ref.ReferenceConstant) IntegerVariable(org.evosuite.symbolic.expr.bv.IntegerVariable) VariableReference(org.evosuite.testcase.variable.VariableReference) EvosuiteError(org.evosuite.testcase.execution.EvosuiteError) CodeUnderTestException(org.evosuite.testcase.execution.CodeUnderTestException)

Aggregations

EvosuiteError (org.evosuite.testcase.execution.EvosuiteError)21 VariableReference (org.evosuite.testcase.variable.VariableReference)15 CodeUnderTestException (org.evosuite.testcase.execution.CodeUnderTestException)14 ReferenceConstant (org.evosuite.symbolic.expr.ref.ReferenceConstant)11 IntegerVariable (org.evosuite.symbolic.expr.bv.IntegerVariable)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 Method (java.lang.reflect.Method)3 Set (java.util.Set)3 UncompilableCodeException (org.evosuite.testcase.execution.UncompilableCodeException)3 LinkedHashSet (java.util.LinkedHashSet)2 ConstructionFailedException (org.evosuite.ga.ConstructionFailedException)2 IntegerValue (org.evosuite.symbolic.expr.bv.IntegerValue)2 RealValue (org.evosuite.symbolic.expr.fp.RealValue)2 RealVariable (org.evosuite.symbolic.expr.fp.RealVariable)2 ReferenceExpression (org.evosuite.symbolic.expr.ref.ReferenceExpression)2 DefaultTestCase (org.evosuite.testcase.DefaultTestCase)2 MethodStatement (org.evosuite.testcase.statements.MethodStatement)2 Statement (org.evosuite.testcase.statements.Statement)2 StringPrimitiveStatement (org.evosuite.testcase.statements.StringPrimitiveStatement)2 GenericMethod (org.evosuite.utils.generic.GenericMethod)2