modelcheck: capture exceptions by const reference

* tests/ltsmin/modelcheck.cc: here.
This commit is contained in:
Etienne Renault 2018-03-28 10:44:26 +02:00
parent 88dc500aa7
commit 9827b1d096

View file

@ -269,7 +269,7 @@ static int checked_main()
model = spot::ltsmin_model::load(mc_options.model) model = spot::ltsmin_model::load(mc_options.model)
.kripke(&ap, dict, deadf, mc_options.compress); .kripke(&ap, dict, deadf, mc_options.compress);
} }
catch (std::runtime_error& e) catch (const std::runtime_error& e)
{ {
std::cerr << e.what() << '\n'; std::cerr << e.what() << '\n';
} }
@ -322,7 +322,7 @@ static int checked_main()
{ {
res = ec->check(); res = ec->check();
} }
catch (std::bad_alloc&) catch (const std::bad_alloc&)
{ {
std::cerr << "Out of memory during emptiness check." std::cerr << "Out of memory during emptiness check."
<< std::endl; << std::endl;
@ -357,7 +357,7 @@ static int checked_main()
{ {
run = res->accepting_run(); run = res->accepting_run();
} }
catch (std::bad_alloc&) catch (const std::bad_alloc&)
{ {
std::cerr << "Out of memory while looking for counterexample." std::cerr << "Out of memory while looking for counterexample."
<< std::endl; << std::endl;
@ -429,7 +429,7 @@ static int checked_main()
.kripkecube(propcube->get_ap(), deadf, mc_options.compress, .kripkecube(propcube->get_ap(), deadf, mc_options.compress,
mc_options.nb_threads); mc_options.nb_threads);
} }
catch (std::runtime_error& e) catch (const std::runtime_error& e)
{ {
std::cerr << e.what() << '\n'; std::cerr << e.what() << '\n';
} }
@ -535,7 +535,7 @@ static int checked_main()
.kripkecube({}, deadf, mc_options.compress, .kripkecube({}, deadf, mc_options.compress,
mc_options.nb_threads); mc_options.nb_threads);
} }
catch (std::runtime_error& e) catch (const std::runtime_error& e)
{ {
std::cerr << e.what() << '\n'; std::cerr << e.what() << '\n';
} }
@ -631,7 +631,7 @@ static int checked_main()
.kripkecube({}, deadf, mc_options.compress, .kripkecube({}, deadf, mc_options.compress,
mc_options.nb_threads); mc_options.nb_threads);
} }
catch (std::runtime_error& e) catch (const std::runtime_error& e)
{ {
std::cerr << e.what() << '\n'; std::cerr << e.what() << '\n';
} }