use of org.evosuite.seeding.ConstantPool in project evosuite by EvoSuite.
the class BytePrimitiveStatement method randomize.
/* (non-Javadoc)
* @see org.evosuite.testcase.PrimitiveStatement#randomize()
*/
/**
* {@inheritDoc}
*/
@Override
public void randomize() {
if (Randomness.nextDouble() >= Properties.PRIMITIVE_POOL)
value = (byte) (Randomness.nextInt(256) - 128);
else {
ConstantPool constantPool = ConstantPoolManager.getInstance().getConstantPool();
value = (byte) constantPool.getRandomInt();
}
}
use of org.evosuite.seeding.ConstantPool in project evosuite by EvoSuite.
the class DoublePrimitiveStatement method randomize.
/* (non-Javadoc)
* @see org.evosuite.testcase.PrimitiveStatement#randomize()
*/
/**
* {@inheritDoc}
*/
@Override
public void randomize() {
if (Randomness.nextDouble() >= Properties.PRIMITIVE_POOL) {
value = Randomness.nextGaussian() * Properties.MAX_INT;
int precision = Randomness.nextInt(15);
chopPrecision(precision);
} else {
ConstantPool constantPool = ConstantPoolManager.getInstance().getConstantPool();
value = constantPool.getRandomDouble();
}
}
use of org.evosuite.seeding.ConstantPool in project evosuite by EvoSuite.
the class IntPrimitiveStatement method randomize.
/* (non-Javadoc)
* @see org.evosuite.testcase.PrimitiveStatement#randomize()
*/
/**
* {@inheritDoc}
*/
@Override
public void randomize() {
if (Randomness.nextDouble() >= Properties.PRIMITIVE_POOL) {
value = (int) (Randomness.nextGaussian() * Properties.MAX_INT);
} else {
ConstantPool constantPool = ConstantPoolManager.getInstance().getConstantPool();
value = constantPool.getRandomInt();
}
}
Aggregations