Commit 91f3555f authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Re-enable a mjsunit/wasm/exceptions test case.

R=ahaas@chromium.org
TEST=mjsunit/wasm/exceptions
BUG=v8:8091

Change-Id: If811fdffe31df3ca94c70ff910603fab8d7e1ad4
Reviewed-on: https://chromium-review.googlesource.com/1190303
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55442}
parent 8e0feb68
......@@ -375,12 +375,10 @@ assertWasmThrows(0, [16404, 0, 0, 0],
assertWasmThrows(0, [16739, 4816, 0, 0],
function() { test_throw_param_d.exports.throw_param(10000000.5); });
/* TODO(kschimpf) Convert these tests to work for the proposed exceptions.
// The following methods do not attempt to catch the exception they raise.
var test_throw = (function () {
var builder = new WasmModuleBuilder();
builder.addException(kSig_v_i);
builder.addFunction("throw_expr_with_params", kSig_v_ddi)
.addBody([
// p2 * (p0 + min(p0, p1))|0 - 20
......@@ -394,7 +392,7 @@ var test_throw = (function () {
kExprI32Mul,
kExprI32Const, 20,
kExprI32Sub,
kExprThrow,
kExprThrow, 0,
])
.exportFunc()
......@@ -408,11 +406,12 @@ assertFalse(test_throw === 0);
assertEquals("object", typeof test_throw.exports);
assertEquals("function", typeof test_throw.exports.throw_expr_with_params);
assertEquals(1, test_throw.exports.throw_param_if_not_zero(0));
assertWasmThrows(
-8, function() { test_throw.exports.throw_expr_with_params(1.5, 2.5, 4); });
assertWasmThrows(
12, function() { test_throw.exports.throw_expr_with_params(5.7, 2.5, 4); });
assertWasmThrows(0, [65535, 65536-8],
function() { test_throw.exports.throw_expr_with_params(1.5, 2.5, 4); });
assertWasmThrows(0, [0, 12],
function() { test_throw.exports.throw_expr_with_params(5.7, 2.5, 4); });
/* TODO(mstarzinger): Re-enable the following test cases.
// Now that we know throwing works, we test catching the exceptions we raise.
var test_catch = (function () {
......
......@@ -431,7 +431,8 @@ function assertWasmThrows(runtime_id, values, code) {
// Success.
return;
}
throw new MjsUnitAssertionError('Did not throw expected: ' + runtime_id + values);
throw new MjsUnitAssertionError('Did not throw expected <' + runtime_id +
'> with values: ' + values);
}
function wasmI32Const(val) {
......
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