use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestDefaultValue method testByte.
@Test
public void testByte() throws SecurityException, NoSuchMethodException {
TestCaseBuilder builder = new TestCaseBuilder();
ArrayReference integerArray0 = builder.appendArrayStmt(Byte[].class, 10);
VariableReference integer0 = builder.appendNull(Byte.class);
builder.appendAssignment(integerArray0, 0, integer0);
builder.appendAssignment(integer0, integerArray0, 0);
builder.appendMethod(integer0, Byte.class.getMethod("toString"));
DefaultTestCase tc = builder.getDefaultTestCase();
ExecutionResult ret_val = TestCaseExecutor.runTest(tc);
assertNotNull(ret_val);
assertFalse(ret_val.explicitExceptions.isEmpty());
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestStringSearch2 method buildTestCase.
private DefaultTestCase buildTestCase(String stringVal) throws SecurityException, NoSuchMethodException {
TestCaseBuilder tc = new TestCaseBuilder();
VariableReference string0 = tc.appendStringPrimitive(stringVal);
Method method = StringSearch2.class.getMethod("checkPathURN", String.class);
tc.appendMethod(null, method, string0);
return tc.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestSolverFloats method buildTestCaseFloatMod.
private static DefaultTestCase buildTestCaseFloatMod() throws SecurityException, NoSuchMethodException {
TestCaseBuilder tc = new TestCaseBuilder();
VariableReference double0 = tc.appendDoublePrimitive(2.2 % 2.0);
Method method = TestCaseFloatMod.class.getMethod("test", double.class);
tc.appendMethod(null, method, double0);
return tc.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestSolverFloats method buildTestCaseGt.
private static DefaultTestCase buildTestCaseGt() throws SecurityException, NoSuchMethodException {
TestCaseBuilder tc = new TestCaseBuilder();
VariableReference int0 = tc.appendDoublePrimitive(Math.PI);
VariableReference int1 = tc.appendDoublePrimitive(Math.PI - 1);
Method method = TestCaseFloatGt.class.getMethod("test", double.class, double.class);
tc.appendMethod(null, method, int0, int1);
return tc.getDefaultTestCase();
}
use of org.evosuite.symbolic.TestCaseBuilder in project evosuite by EvoSuite.
the class TestSolverFloats method buildTestCaseAtan.
private static DefaultTestCase buildTestCaseAtan() throws SecurityException, NoSuchMethodException {
TestCaseBuilder tc = new TestCaseBuilder();
VariableReference double0 = tc.appendDoublePrimitive(Math.atan(Math.PI));
VariableReference double1 = tc.appendDoublePrimitive(Math.PI);
Method method = TestCaseAtan.class.getMethod("test", double.class, double.class);
tc.appendMethod(null, method, double0, double1);
return tc.getDefaultTestCase();
}
Aggregations