use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class B_ValueOf method executeFunction.
@Override
public Object executeFunction() {
IntegerValue int_value = this.getSymbIntegerArgument(0);
ReferenceConstant symb_byte = (ReferenceConstant) this.getSymbRetVal();
Byte conc_byte = (Byte) this.getConcRetVal();
env.heap.putField(Types.JAVA_LANG_BYTE, SymbolicHeap.$BYTE_VALUE, conc_byte, symb_byte, int_value);
return symb_byte;
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class ToString method executeFunction.
@Override
public Object executeFunction() {
// object receiver
ReferenceConstant symb_str = this.getSymbReceiver();
String conc_str = (String) this.getConcReceiver();
// return value
String conc_ret_val = (String) this.getConcRetVal();
ReferenceConstant symb_ret_val = (ReferenceConstant) this.getSymbRetVal();
StringValue string_expr = env.heap.getField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_str, symb_str, conc_str);
env.heap.putField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_ret_val, symb_ret_val, string_expr);
return this.getSymbRetVal();
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class Trim method executeFunction.
@Override
public Object executeFunction() {
// object receiver
ReferenceConstant symb_str = this.getSymbReceiver();
String conc_str = (String) this.getConcReceiver();
// return value
String conc_ret_val = (String) this.getConcRetVal();
ReferenceConstant symb_ret_val = (ReferenceConstant) this.getSymbRetVal();
StringValue string_expr = env.heap.getField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_str, symb_str, conc_str);
StringUnaryExpression symb_value = new StringUnaryExpression(string_expr, Operator.TRIM, conc_ret_val);
env.heap.putField(Types.JAVA_LANG_STRING, SymbolicHeap.$STRING_VALUE, conc_ret_val, symb_ret_val, symb_value);
return this.getSymbRetVal();
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class SymbolicObserver method after.
private void after(BytePrimitiveStatement statement, Scope scope) {
byte valueOf = statement.getValue();
VariableReference varRef = statement.getReturnValue();
String varRefName = varRef.getName();
IntegerVariable integerVariable = buildIntegerVariable(varRefName, valueOf, Byte.MIN_VALUE, Byte.MAX_VALUE);
symb_expressions.put(varRefName, integerVariable);
Byte byte_instance;
try {
byte_instance = (Byte) varRef.getObject(scope);
} catch (CodeUnderTestException e) {
throw new EvosuiteError(e);
}
ReferenceConstant byteRef = newByteReference(byte_instance, integerVariable);
symb_references.put(varRefName, byteRef);
}
use of org.evosuite.symbolic.expr.ref.ReferenceConstant in project evosuite by EvoSuite.
the class SymbolicObserver method newShortReference.
private ReferenceConstant newShortReference(Short conc_short, IntegerValue symb_value) {
ReferenceConstant shortRef = (ReferenceConstant) env.heap.getReference(conc_short);
env.heap.putField(Types.JAVA_LANG_SHORT, SymbolicHeap.$SHORT_VALUE, conc_short, shortRef, symb_value);
return shortRef;
}
Aggregations