mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
fix #6535
This commit is contained in:
parent
0d46787fcf
commit
d289434b65
|
@ -67,7 +67,7 @@ void test_parseprint(char const* spec) {
|
||||||
void test_eval(Z3_context ctx, Z3_string spec, bool shouldFail) {
|
void test_eval(Z3_context ctx, Z3_string spec, bool shouldFail) {
|
||||||
std::cout << "spec:\n" << spec << "\n";
|
std::cout << "spec:\n" << spec << "\n";
|
||||||
|
|
||||||
Z3_string resp;
|
std::string resp;
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
try {
|
try {
|
||||||
resp = Z3_eval_smtlib2_string(ctx, spec);
|
resp = Z3_eval_smtlib2_string(ctx, spec);
|
||||||
|
@ -76,6 +76,10 @@ void test_eval(Z3_context ctx, Z3_string spec, bool shouldFail) {
|
||||||
resp = e.what();
|
resp = e.what();
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
catch (...) {
|
||||||
|
resp = "unknown exception";
|
||||||
|
failed = true;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "response:\n" << resp << "\n";
|
std::cout << "response:\n" << resp << "\n";
|
||||||
|
|
||||||
|
@ -141,6 +145,7 @@ void test_repeated_eval() {
|
||||||
Z3_set_error_handler(ctx, throwError);
|
Z3_set_error_handler(ctx, throwError);
|
||||||
std::cout << "testing Z3_eval_smtlib2_string\n";
|
std::cout << "testing Z3_eval_smtlib2_string\n";
|
||||||
|
|
||||||
|
try {
|
||||||
test_eval(ctx, spec1, false);
|
test_eval(ctx, spec1, false);
|
||||||
std::cout << "successful call after successful call\n";
|
std::cout << "successful call after successful call\n";
|
||||||
test_eval(ctx, spec2, false);
|
test_eval(ctx, spec2, false);
|
||||||
|
@ -150,6 +155,11 @@ void test_repeated_eval() {
|
||||||
test_eval(ctx, spec4, true);
|
test_eval(ctx, spec4, true);
|
||||||
std::cout << "successful call after failing call\n";
|
std::cout << "successful call after failing call\n";
|
||||||
test_eval(ctx, spec1, false);
|
test_eval(ctx, spec1, false);
|
||||||
|
}
|
||||||
|
catch(...) {
|
||||||
|
std::cout << "Error: uncaught exception\n";
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "done evaluating\n";
|
std::cout << "done evaluating\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue