Commit 10ffb113 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[test] Print diagnostic message on failure in test-gc.cc

Making test failures more convenient to debug than simply failing
a .ToHandleChecked() call.

Change-Id: Ieb4553bec8886d1a4eb0dbf0c7bc53ac6435a82c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2412528
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarManos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69928}
parent a7fc8375
......@@ -1059,10 +1059,20 @@ TEST(JsAccess) {
isolate->clear_pending_exception();
maybe_result = tester.CallExportedFunction("producer", 0, nullptr);
if (maybe_result.is_null()) {
FATAL("Calling 'producer' failed: %s",
*v8::String::Utf8Value(reinterpret_cast<v8::Isolate*>(isolate),
try_catch.Message()->Get()));
}
{
Handle<Object> args[] = {maybe_result.ToHandleChecked()};
maybe_result = tester.CallExportedFunction("consumer", 1, args);
}
if (maybe_result.is_null()) {
FATAL("Calling 'consumer' failed: %s",
*v8::String::Utf8Value(reinterpret_cast<v8::Isolate*>(isolate),
try_catch.Message()->Get()));
}
Handle<Object> result = maybe_result.ToHandleChecked();
CHECK(result->IsSmi());
CHECK_EQ(42, Smi::cast(*result).value());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment