Skip to content

Commit 8701a55

Browse files
Added C++ test case for JavaSMT bug sosy-lab/java-smt#347
1 parent 983fe52 commit 8701a55

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

test/api/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ cvc5_add_api_test(two_solvers)
5858
cvc5_add_api_test(issue5074)
5959
cvc5_add_api_test(issue4889)
6060
cvc5_add_api_test(issue6111)
61+
cvc5_add_api_test(javasmt-bug347)
6162
cvc5_add_api_test(proj-issue306)
6263
cvc5_add_api_test(proj-issue334)
6364
cvc5_add_api_test(proj-issue344)

test/api/cpp/javasmt-bug347.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/******************************************************************************
2+
* Top contributors (to current version):
3+
* Morgan Deters, Andrew Reynolds, Mathias Preiner
4+
*
5+
* This file is part of the cvc5 project.
6+
*
7+
* Copyright (c) 2009-2023 by the authors listed in the file AUTHORS
8+
* in the top-level source directory and their institutional affiliations.
9+
* All rights reserved. See the file COPYING in the top-level source
10+
* directory for licensing information.
11+
* ****************************************************************************
12+
*
13+
* Test for JavaSMT bug #347
14+
* https://github.com/sosy-lab/java-smt/issues/347
15+
*/
16+
17+
#include <cassert>
18+
#include <cvc5/cvc5.h>
19+
#include <iostream>
20+
#include <thread>
21+
22+
using namespace cvc5;
23+
24+
void task() {
25+
Solver* solver = new Solver();
26+
Term formula = solver->mkBoolean(false);
27+
28+
solver->push();
29+
solver->assertFormula(formula);
30+
31+
assert(!solver->checkSat().isSat());
32+
33+
delete solver;
34+
};
35+
36+
int main() {
37+
for (int k=0; k < 100; k++) {
38+
std::cout << k << std::endl;
39+
40+
std::thread t1(task);
41+
std::thread t2(task);
42+
43+
t1.join();
44+
t2.join();
45+
}
46+
}

0 commit comments

Comments
 (0)