use of org.evosuite.symbolic.expr.bv.StringToIntegerCast in project evosuite by EvoSuite.
the class I_ParseInt method executeFunction.
@Override
public Object executeFunction() {
ReferenceConstant symb_string_ref = (ReferenceConstant) this.getSymbArgument(0);
String conc_string = (String) this.getConcArgument(0);
int conc_integer = this.getConcIntRetVal();
StringValue symb_string_value = env.heap.getField(org.evosuite.symbolic.vm.regex.Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_string, symb_string_ref, conc_string);
long longValue = (long) conc_integer;
StringToIntegerCast parse_int_value = new StringToIntegerCast(symb_string_value, longValue);
return parse_int_value;
}
use of org.evosuite.symbolic.expr.bv.StringToIntegerCast in project evosuite by EvoSuite.
the class TestConstraintSolver3 method buildConstraintSystem.
private static Collection<Constraint<?>> buildConstraintSystem() {
StringVariable var0 = new StringVariable("var0", INIT_STRING);
StringToIntegerCast castStr = new StringToIntegerCast(var0, (long) Integer.parseInt(INIT_STRING));
IntegerConstant const126 = new IntegerConstant(EXPECTED_INTEGER);
IntegerConstraint constr1 = new IntegerConstraint(castStr, Comparator.EQ, const126);
return Arrays.<Constraint<?>>asList(constr1);
}
use of org.evosuite.symbolic.expr.bv.StringToIntegerCast in project evosuite by EvoSuite.
the class BigInteger_Ctor method executeFunction.
@Override
public Object executeFunction() {
String conc_string = (String) this.getConcArgument(0);
ReferenceConstant str_ref = (ReferenceConstant) this.getSymbArgument(0);
StringValue symb_string = this.env.heap.getField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_string, str_ref, conc_string);
if (symb_string.containsSymbolicVariable()) {
ReferenceConstant symb_big_integer = (ReferenceConstant) env.topFrame().operandStack.peekRef();
BigInteger bigInteger = new BigInteger(conc_string);
long concVal = bigInteger.longValue();
StringToIntegerCast big_integer_value = new StringToIntegerCast(symb_string, concVal);
env.heap.putField(Types.JAVA_MATH_BIG_INTEGER, SymbolicHeap.$BIG_INTEGER_CONTENTS, null, /* conc_big_integer */
symb_big_integer, big_integer_value);
}
// return void
return null;
}
Aggregations