use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverReader method testStringReader.
public static Map<String, Object> testStringReader(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestStringReader();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
return solution;
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverSimpleMath method testMod.
public static void testMod(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseMod();
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(var0.intValue(), var1.intValue() % 2);
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverSimpleMath method testMul2.
public static Map<String, Object> testMul2(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseMul2();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
return solution;
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverSimpleMath method testGt.
public static void testGt(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseGt();
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");
assertTrue(var0.intValue() > var1.intValue());
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverSimpleMath method testSub.
public static void testSub(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseSub();
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(var0.intValue(), var1.intValue() - 10);
}
Aggregations