acc: turn some assertions into exceptions

* spot/misc/bitset.cc, spot/misc/bitset.hh (set, clear):
Turn asserts into exceptions.
* spot/twa/acc.hh (mark_t): As a consequence, the
constructor is not noexcept anymore.
* tests/core/acc.cc, tests/python/except.py: More tests.
This commit is contained in:
Alexandre Duret-Lutz 2018-05-26 09:44:18 +02:00
parent be0997c97a
commit 6d9d35c985
5 changed files with 46 additions and 6 deletions

View file

@ -218,6 +218,14 @@ int main()
{
assert(!std::strncmp(e.what(), "Too many acceptance sets used.", 30));
}
try
{
spot::acc_cond::mark_t m{spot::acc_cond::mark_t::max_accsets()};
}
catch (const std::runtime_error& e)
{
assert(!std::strcmp(e.what(), "bit index is out of bounds"));
}
#endif
return 0;