twa_graph: fix precondition on set_init_state

Fixes #391.

* spot/twa/twagraph.hh: Here.
* tests/core/dualize.test, tests/python/except.py: New tests.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2019-07-30 15:30:36 +02:00
parent f29eb91192
commit 8ec6ea838d
4 changed files with 107 additions and 4 deletions

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018 Laboratoire de Recherche et Développement de
# Copyright (C) 2018, 2019 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -93,6 +93,25 @@ except RuntimeError as e:
else:
report_missing_exception()
try:
alt.set_init_state(999)
except ValueError as e:
assert "set_init_state()" in str(e)
else:
report_missing_exception()
alt.set_univ_init_state([s1, s2])
u = alt.get_init_state_number()
alt.set_init_state(u)
try:
alt.set_init_state(u - 1)
except ValueError as e:
assert "set_init_state()" in str(e)
else:
report_missing_exception()
r = spot.twa_run(aut)
try:
a = r.as_twa()