use of eu.stamp_project.dspot.amplifier.amplifiers.NumberLiteralAmplifier in project dspot by STAMP-project.
the class NumberLiteralAmplifierTest method testLongMutation.
@Test
public void testLongMutation() {
final String nameMethod = "methodLong";
final long originalValue = 23L;
CtClass<Object> literalMutationClass = launcher.getFactory().Class().get("fr.inria.amp.LiteralMutation");
RandomHelper.setSeedRandom(42L);
NumberLiteralAmplifier amplifier = getAmplifier(literalMutationClass);
CtMethod method = literalMutationClass.getMethod(nameMethod);
List<Long> expectedValues = Arrays.asList(22L, 24L, 0L, -935319508L);
List<String> expectedFieldReads = Arrays.asList("java.lang.Long.MAX_VALUE", "java.lang.Long.MIN_VALUE");
List<CtMethod> mutantMethods = amplifier.amplify(method, 0).collect(Collectors.toList());
callAssertions(mutantMethods, nameMethod, expectedValues, expectedFieldReads, originalValue, 6);
}
use of eu.stamp_project.dspot.amplifier.amplifiers.NumberLiteralAmplifier in project dspot by STAMP-project.
the class NumberLiteralAmplifierTest method testByteMutation.
@Test
public void testByteMutation() {
final String nameMethod = "methodByte";
final byte originalValue = 23;
CtClass<Object> literalMutationClass = launcher.getFactory().Class().get("fr.inria.amp.LiteralMutation");
RandomHelper.setSeedRandom(42L);
NumberLiteralAmplifier amplifier = getAmplifier(literalMutationClass);
CtMethod method = literalMutationClass.getMethod(nameMethod);
List<Byte> expectedValues = Arrays.asList((byte) 22, (byte) 24, (byte) 0, (byte) 53);
List<String> expectedFieldReads = Arrays.asList("java.lang.Byte.MAX_VALUE", "java.lang.Byte.MIN_VALUE");
List<CtMethod> mutantMethods = amplifier.amplify(method, 0).collect(Collectors.toList());
callAssertions(mutantMethods, nameMethod, expectedValues, expectedFieldReads, originalValue, 6);
}
Aggregations