Search in sources :

Example 6 with ConstantPool

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();
    }
}
Also used : ConstantPool(org.evosuite.seeding.ConstantPool)

Example 7 with ConstantPool

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();
    }
}
Also used : ConstantPool(org.evosuite.seeding.ConstantPool)

Example 8 with ConstantPool

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();
    }
}
Also used : ConstantPool(org.evosuite.seeding.ConstantPool)

Aggregations

ConstantPool (org.evosuite.seeding.ConstantPool)8 EvoSuiteRemoteAddress (org.evosuite.runtime.testdata.EvoSuiteRemoteAddress)1 EndPointInfo (org.evosuite.runtime.vnet.EndPointInfo)1