From 0355b29358f57e7a1e5ccd63e9c00a3546eb0c26 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 28 Oct 2020 18:03:57 +0100 Subject: [PATCH] Use xbt_die instead of xbt_assert(false). --- src/kernel/resource/profile/Profile.cpp | 6 ++---- src/kernel/resource/profile/StochasticDatedValue.cpp | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kernel/resource/profile/Profile.cpp b/src/kernel/resource/profile/Profile.cpp index f83e605714..9a85416023 100644 --- a/src/kernel/resource/profile/Profile.cpp +++ b/src/kernel/resource/profile/Profile.cpp @@ -146,8 +146,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, stochevent.date_law = Distribution::UNIF; i = 3; } else { - xbt_assert(false, "Unknown law %s", splittedval[0].c_str()); - i = 0; + xbt_die("Unknown law %s", splittedval[0].c_str()); } xbt_assert(splittedval.size() > i, "Invalid profile line"); @@ -171,8 +170,7 @@ Profile* Profile::from_string(const std::string& name, const std::string& input, stochevent.value_law = Distribution::UNIF; j = 2; } else { - xbt_assert(false, "Unknown law %s", splittedval[i].c_str()); - j = 0; + xbt_die("Unknown law %s", splittedval[i].c_str()); } xbt_assert(splittedval.size() > i + j, "Invalid profile line"); diff --git a/src/kernel/resource/profile/StochasticDatedValue.cpp b/src/kernel/resource/profile/StochasticDatedValue.cpp index 0695de3e53..6830b75bc8 100644 --- a/src/kernel/resource/profile/StochasticDatedValue.cpp +++ b/src/kernel/resource/profile/StochasticDatedValue.cpp @@ -24,8 +24,7 @@ double StochasticDatedValue::draw(Distribution law, std::vector params) case Distribution::NORM: return simgrid::xbt::random::normal(params[0], params[1]); default: - xbt_assert(false, "Unimplemented distribution"); - return 0; + xbt_die("Unimplemented distribution"); } } double StochasticDatedValue::get_value() -- 2.20.1