3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-03 21:01:22 +00:00

deal with unit test failure cases, fixes #132 #133

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-06-17 17:30:10 -07:00 committed by Christoph M. Wintersteiger
parent 1bdedec920
commit 22c0a593e7
4 changed files with 8 additions and 6 deletions

View file

@ -101,9 +101,10 @@ public:
resize_data(0); resize_data(0);
#if _WINDOWS #if _WINDOWS
errno_t err = fopen_s(&m_file, fname, "rb"); errno_t err = fopen_s(&m_file, fname, "rb");
m_ok = err == 0; m_ok = (m_file != NULL) && (err == 0);
#else #else
m_file = fopen(fname, "rb"); m_file = fopen(fname, "rb");
m_ok = (m_file != NULL);
#endif #endif
} }
~line_reader() { ~line_reader() {

View file

@ -62,8 +62,9 @@ void dl_context_saturate_file(params_ref & params, const char * f) {
ctx.updt_params(params); ctx.updt_params(params);
datalog::parser * parser = datalog::parser::create(ctx, m); datalog::parser * parser = datalog::parser::create(ctx, m);
if (!parser->parse_file(f)) { if (!parser || !parser->parse_file(f)) {
warning_msg("ERROR: failed to parse file"); warning_msg("ERROR: failed to parse file");
dealloc(parser);
return; return;
} }
dealloc(parser); dealloc(parser);

View file

@ -64,7 +64,7 @@ void dl_query_test(ast_manager & m, smt_params & fparams, params_ref& params,
ctx_q.updt_params(params); ctx_q.updt_params(params);
{ {
parser* p = parser::create(ctx_q,m); parser* p = parser::create(ctx_q,m);
bool ok = p->parse_file(problem_file); bool ok = p && p->parse_file(problem_file);
dealloc(p); dealloc(p);
if (!ok) { if (!ok) {
std::cout << "Could not parse: " << problem_file << "\n"; std::cout << "Could not parse: " << problem_file << "\n";

View file

@ -27,7 +27,7 @@ struct test_model_search {
}; };
ast_manager m; ast_manager m;
smt_params smt_params; smt_params m_smt_params;
fixedpoint_params fp_params; fixedpoint_params fp_params;
context ctx; context ctx;
manager pm; manager pm;
@ -40,8 +40,8 @@ struct test_model_search {
test_model_search(): test_model_search():
ctx(smt_params, fp_params, m), ctx(m_smt_params, fp_params, m),
pm(smt_params, 10, m), pm(m_smt_params, 10, m),
fn(m), fn(m),
initt(fn), initt(fn),
pt(ctx, pm, fn), pt(ctx, pm, fn),