use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverFloats method testTan.
public static void testTan(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseTan();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Double var0 = (Double) solution.get("var0");
Double var1 = (Double) solution.get("var1");
assertEquals(var0.doubleValue(), Math.tan(var1.doubleValue()), DELTA);
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverFloats method testLog.
public static void testLog(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseLog();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Double var0 = (Double) solution.get("var0");
Double var1 = (Double) solution.get("var1");
assertEquals(var0.doubleValue(), Math.tan(var1.doubleValue()), DELTA);
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverFloats method testAsin.
public static void testAsin(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseAsin();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Double var0 = (Double) solution.get("var0");
Double var1 = (Double) solution.get("var1");
assertEquals(var0.doubleValue(), Math.asin(var1.doubleValue()), DELTA);
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverFloats method testSqrt.
public static void testSqrt(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseSqrt();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Double var0 = (Double) solution.get("var0");
Double var1 = (Double) solution.get("var1");
assertEquals(var0.doubleValue(), Math.sqrt(var1.doubleValue()), DELTA);
}
use of org.evosuite.symbolic.expr.Constraint in project evosuite by EvoSuite.
the class TestSolverFloats method testFraction.
public static void testFraction(Solver solver) throws SecurityException, NoSuchMethodException, SolverTimeoutException {
DefaultTestCase tc = buildTestCaseFraction();
Collection<Constraint<?>> constraints = DefaultTestCaseConcolicExecutor.execute(tc);
Map<String, Object> solution = solve(solver, constraints);
assertNotNull(solution);
Double var0 = (Double) solution.get("var0");
assertTrue(var0.doubleValue() > 0);
assertTrue(var0.doubleValue() < 1);
}
Aggregations