mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 07:07:36 +00:00
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
This commit is contained in:
parent
b33a6a443e
commit
5d180d1f99
725 changed files with 3448 additions and 3448 deletions
|
@ -121,7 +121,7 @@ public:
|
|||
: m_test_root(move(test_root))
|
||||
, m_print_times(print_times)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
VERIFY(!s_the);
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ static double get_time_in_ms()
|
|||
{
|
||||
struct timeval tv1;
|
||||
auto return_code = gettimeofday(&tv1, nullptr);
|
||||
ASSERT(return_code >= 0);
|
||||
VERIFY(return_code >= 0);
|
||||
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
|
||||
}
|
||||
|
||||
|
@ -334,16 +334,16 @@ JSFileResult TestRunner::run_file_test(const String& test_path)
|
|||
test_json.value().as_object().for_each_member([&](const String& suite_name, const JsonValue& suite_value) {
|
||||
JSSuite suite { suite_name };
|
||||
|
||||
ASSERT(suite_value.is_object());
|
||||
VERIFY(suite_value.is_object());
|
||||
|
||||
suite_value.as_object().for_each_member([&](const String& test_name, const JsonValue& test_value) {
|
||||
JSTest test { test_name, TestResult::Fail, "" };
|
||||
|
||||
ASSERT(test_value.is_object());
|
||||
ASSERT(test_value.as_object().has("result"));
|
||||
VERIFY(test_value.is_object());
|
||||
VERIFY(test_value.as_object().has("result"));
|
||||
|
||||
auto result = test_value.as_object().get("result");
|
||||
ASSERT(result.is_string());
|
||||
VERIFY(result.is_string());
|
||||
auto result_string = result.as_string();
|
||||
if (result_string == "pass") {
|
||||
test.result = TestResult::Pass;
|
||||
|
@ -352,9 +352,9 @@ JSFileResult TestRunner::run_file_test(const String& test_path)
|
|||
test.result = TestResult::Fail;
|
||||
m_counts.tests_failed++;
|
||||
suite.most_severe_test_result = TestResult::Fail;
|
||||
ASSERT(test_value.as_object().has("details"));
|
||||
VERIFY(test_value.as_object().has("details"));
|
||||
auto details = test_value.as_object().get("details");
|
||||
ASSERT(result.is_string());
|
||||
VERIFY(result.is_string());
|
||||
test.details = details.as_string();
|
||||
} else {
|
||||
test.result = TestResult::Skip;
|
||||
|
@ -425,7 +425,7 @@ static void print_modifiers(Vector<Modifier> modifiers)
|
|||
case CLEAR:
|
||||
return "\033[0m";
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}();
|
||||
out("{}", code);
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ JSFileResult Test262ParserTestRunner::run_file_test(const String& test_path)
|
|||
} else if (dirname.ends_with("pass") || dirname.ends_with("pass-explicit")) {
|
||||
expecting_file_to_parse = true;
|
||||
} else {
|
||||
ASSERT_NOT_REACHED();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
auto start_time = get_time_in_ms();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue