Skip to content

Commit 36919ed

Browse files
Removed native API test for bug339 as it has been fixed.
1 parent 80ede24 commit 36919ed

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

src/org/sosy_lab/java_smt/solvers/mathsat5/Mathsat5NativeApiTest.java

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -534,80 +534,4 @@ public void enumTypeTest() throws SolverException, InterruptedException {
534534
assertThat(msat_check_sat(env)).isFalse();
535535
msat_pop_backtrack_point(env);
536536
}
537-
538-
private final ExecutorService executor = Executors.newSingleThreadExecutor();
539-
540-
private long createSharedEnv(long sibling) {
541-
long cfg = msat_create_config();
542-
msat_set_option_checked(cfg, "dpll.ghost_filtering", "true");
543-
msat_set_option_checked(cfg, "theory.la.split_rat_eq", "false");
544-
545-
long prover = msat_create_shared_env(cfg, sibling);
546-
msat_destroy_config(cfg);
547-
548-
return prover;
549-
}
550-
551-
private long makeLt(long e, long t1, long t2) {
552-
return msat_make_not(e, msat_make_leq(e, t2, t1));
553-
}
554-
555-
@SuppressWarnings("unused")
556-
@Test(expected = StackOverflowError.class)
557-
public void bug339BrokenTest() throws ExecutionException, InterruptedException {
558-
long integerType = msat_get_integer_type(env);
559-
560-
long varA = msat_make_variable(env, "A", integerType);
561-
long varB = msat_make_variable(env, "B", integerType);
562-
563-
long formula = msat_make_and(env, makeLt(env, varA, varB), makeLt(env, varB, varA));
564-
long prover = createSharedEnv(this.env);
565-
566-
// FIXME: Bug #339 is caused by this line. Removing it will fix the test.
567-
long hook = msat_set_termination_callback(prover, () -> false);
568-
569-
msat_assert_formula(prover, formula);
570-
571-
Future<?> task1 =
572-
executor.submit(
573-
() -> {
574-
try {
575-
assertThat(msat_check_sat(prover)).isFalse();
576-
} catch (InterruptedException | SolverException pE) {
577-
throw new RuntimeException(pE);
578-
}
579-
});
580-
581-
assert task1.get() == null;
582-
}
583-
584-
@SuppressWarnings("unused")
585-
@Test
586-
public void bug339FixedTest() throws ExecutionException, InterruptedException {
587-
long integerType = msat_get_integer_type(env);
588-
589-
long varA = msat_make_variable(env, "A", integerType);
590-
long varB = msat_make_variable(env, "B", integerType);
591-
592-
long formula = msat_make_and(env, makeLt(env, varA, varB), makeLt(env, varB, varA));
593-
long prover = createSharedEnv(this.env);
594-
595-
msat_assert_formula(prover, formula);
596-
597-
Future<?> task1 =
598-
executor.submit(
599-
() -> {
600-
try {
601-
// FIXME: Bug #339 is not triggered if we add the callback on the thread that
602-
// will do the calculation
603-
long hook = msat_set_termination_callback(prover, () -> false);
604-
605-
assertThat(msat_check_sat(prover)).isFalse();
606-
} catch (InterruptedException | SolverException pE) {
607-
throw new RuntimeException(pE);
608-
}
609-
});
610-
611-
assert task1.get() == null;
612-
}
613537
}

0 commit comments

Comments
 (0)