mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:37:45 +00:00
LibTest: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
parent
783251b98a
commit
4dac287aa5
1 changed files with 7 additions and 7 deletions
|
@ -422,9 +422,9 @@ inline JSFileResult TestRunner::run_file_test(DeprecatedString const& test_path)
|
||||||
VERIFY(test_value.is_object());
|
VERIFY(test_value.is_object());
|
||||||
VERIFY(test_value.as_object().has("result"sv));
|
VERIFY(test_value.as_object().has("result"sv));
|
||||||
|
|
||||||
auto result = test_value.as_object().get_deprecated("result"sv);
|
auto result = test_value.as_object().get_deprecated_string("result"sv);
|
||||||
VERIFY(result.is_string());
|
VERIFY(result.has_value());
|
||||||
auto result_string = result.as_string();
|
auto result_string = result.value();
|
||||||
if (result_string == "pass") {
|
if (result_string == "pass") {
|
||||||
test.result = Test::Result::Pass;
|
test.result = Test::Result::Pass;
|
||||||
m_counts.tests_passed++;
|
m_counts.tests_passed++;
|
||||||
|
@ -433,9 +433,9 @@ inline JSFileResult TestRunner::run_file_test(DeprecatedString const& test_path)
|
||||||
m_counts.tests_failed++;
|
m_counts.tests_failed++;
|
||||||
suite.most_severe_test_result = Test::Result::Fail;
|
suite.most_severe_test_result = Test::Result::Fail;
|
||||||
VERIFY(test_value.as_object().has("details"sv));
|
VERIFY(test_value.as_object().has("details"sv));
|
||||||
auto details = test_value.as_object().get_deprecated("details"sv);
|
auto details = test_value.as_object().get_deprecated_string("details"sv);
|
||||||
VERIFY(result.is_string());
|
VERIFY(result.has_value());
|
||||||
test.details = details.as_string();
|
test.details = details.value();
|
||||||
} else {
|
} else {
|
||||||
test.result = Test::Result::Skip;
|
test.result = Test::Result::Skip;
|
||||||
if (suite.most_severe_test_result == Test::Result::Pass)
|
if (suite.most_severe_test_result == Test::Result::Pass)
|
||||||
|
@ -443,7 +443,7 @@ inline JSFileResult TestRunner::run_file_test(DeprecatedString const& test_path)
|
||||||
m_counts.tests_skipped++;
|
m_counts.tests_skipped++;
|
||||||
}
|
}
|
||||||
|
|
||||||
test.duration_us = test_value.as_object().get_deprecated("duration"sv).to_u64(0);
|
test.duration_us = test_value.as_object().get_u64("duration"sv).value_or(0);
|
||||||
|
|
||||||
suite.tests.append(test);
|
suite.tests.append(test);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue