X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..244ffce80a9e2390e24b9788114de037e4ccc0ae:/src/mc/mc_exit.hpp?ds=sidebyside diff --git a/src/mc/mc_exit.hpp b/src/mc/mc_exit.hpp index b5094ca210..234ea1466a 100644 --- a/src/mc/mc_exit.hpp +++ b/src/mc/mc_exit.hpp @@ -8,22 +8,22 @@ #include "xbt/base.h" #include -constexpr int SIMGRID_MC_EXIT_SUCCESS = 0; -constexpr int SIMGRID_MC_EXIT_SAFETY = 1; -constexpr int SIMGRID_MC_EXIT_LIVENESS = 2; -constexpr int SIMGRID_MC_EXIT_DEADLOCK = 3; -constexpr int SIMGRID_MC_EXIT_NON_TERMINATION = 4; -constexpr int SIMGRID_MC_EXIT_NON_DETERMINISM = 5; -constexpr int SIMGRID_MC_EXIT_PROGRAM_CRASH = 6; - -constexpr int SIMGRID_MC_EXIT_ERROR = 63; - namespace simgrid::mc { -class XBT_PUBLIC DeadlockError : public std::exception { -}; -class XBT_PUBLIC TerminationError : public std::exception { + +enum class ExitStatus { + SUCCESS = 0, + SAFETY = 1, + LIVENESS = 2, + DEADLOCK = 3, + NON_TERMINATION = 4, + NON_DETERMINISM = 5, + PROGRAM_CRASH = 6, + ERROR = 63 }; -class XBT_PUBLIC LivenessError : public std::exception { + +struct McError : public std::exception { + const ExitStatus value; + explicit McError(ExitStatus v = ExitStatus::ERROR) : value(v) {} }; } // namespace simgrid::mc