use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SymbolicObserver method castIfNeeded.
private Expression<?> castIfNeeded(Type elementType, Expression<?> symb_value) {
// cast integer to real if needed
if ((isFp32(elementType) || isFp64(elementType)) && symb_value instanceof IntegerValue) {
IntegerValue intExpr = (IntegerValue) symb_value;
double concValue = intExpr.getConcreteValue().doubleValue();
symb_value = new IntegerToRealCast(intExpr, concValue);
} else if ((isBv32(elementType) || isBv64(elementType)) && symb_value instanceof RealValue) {
RealValue realExpr = (RealValue) symb_value;
long concValue = realExpr.getConcreteValue().longValue();
symb_value = new RealToIntegerCast(realExpr, concValue);
}
return symb_value;
}
Aggregations