use of org.evosuite.testcase.DefaultTestCase in project evosuite by EvoSuite.
the class TestConstraintSolver method testCase2.
@Test
public void testCase2() throws SecurityException, NoSuchMethodException, SolverEmptyQueryException {
DefaultTestCase tc = buildTestCase2();
// build patch condition
List<BranchCondition> branch_conditions = executeTest(tc);
assertEquals(57, branch_conditions.size());
// keep only 2 top-most branch conditions
List<BranchCondition> sublist = new ArrayList<BranchCondition>();
sublist.add(branch_conditions.get(0));
sublist.add(branch_conditions.get(1));
// invoke seeker
try {
SolverResult solverResult = executeSolver(sublist);
assertNotNull(solverResult);
assertTrue(solverResult.isSAT());
} catch (SolverTimeoutException e) {
fail();
}
}
use of org.evosuite.testcase.DefaultTestCase in project evosuite by EvoSuite.
the class TestSolverBitwise method testShiftLeft.
public static Map<String, Object> testShiftLeft(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseShiftLeft();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
return solution;
}
use of org.evosuite.testcase.DefaultTestCase in project evosuite by EvoSuite.
the class TestSolverBitwise method testBitOr.
public static Map<String, Object> testBitOr(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseBitOr();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
return solution;
}
use of org.evosuite.testcase.DefaultTestCase in project evosuite by EvoSuite.
the class TestSolverMath method testMin.
public static void testMin(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseMin();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Long var0 = (Long) solution.get("var0");
Long var1 = (Long) solution.get("var1");
assertEquals(10, Math.min(var0.intValue(), var1.intValue()));
}
use of org.evosuite.testcase.DefaultTestCase in project evosuite by EvoSuite.
the class TestSolverMath method testMax.
public static void testMax(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseMax();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Long var0 = (Long) solution.get("var0");
Long var1 = (Long) solution.get("var1");
assertEquals(10, Math.max(var0.intValue(), var1.intValue()));
}
Aggregations