fix crash of randaut -Q0

* src/twaalgos/randomgraph.cc: Replace an assertion by an exception.
* src/bin/randaut.cc: Diagnose -Q0.
* src/tests/randaut.test: Test it.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2015-10-15 13:29:59 +02:00
parent cd2e527526
commit 6cf807da6e
4 changed files with 10 additions and 1 deletions

View file

@ -126,7 +126,8 @@ namespace spot
unsigned n_accs, float a, float t,
bool deterministic, bool state_acc, bool colored)
{
assert(n > 0);
if (n <= 0)
throw std::invalid_argument("random_graph() requires n>0 states");
auto res = make_twa_graph(dict);
if (deterministic)
res->prop_deterministic();