Commit 9b8e034b authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][test] Use EXPECT_FAILURE consistently

First CL in a series to improve our module decoder tests and make them
more readable.

R=titzer@chromium.org

Bug: v8:8238
Change-Id: Ie6ac83fbe2f873bfda8597ab3dd9ec4c0fb548ad
Reviewed-on: https://chromium-review.googlesource.com/c/1283054Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56702}
parent 94850f5c
......@@ -310,8 +310,7 @@ TEST_F(WasmModuleVerifyTest, Global_invalid_type) {
WASM_INIT_EXPR_I32V_1(33), // init
};
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, Global_invalid_type2) {
......@@ -323,8 +322,7 @@ TEST_F(WasmModuleVerifyTest, Global_invalid_type2) {
WASM_INIT_EXPR_I32V_1(33), // init
};
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, ZeroGlobals) {
......@@ -529,8 +527,7 @@ TEST_F(WasmModuleVerifyTest, Exception_invalid_sig_index) {
// Should fail decoding exception section.
WASM_FEATURE_SCOPE(eh);
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, Exception_invalid_sig_return) {
......@@ -542,8 +539,7 @@ TEST_F(WasmModuleVerifyTest, Exception_invalid_sig_return) {
// Should fail decoding exception section.
WASM_FEATURE_SCOPE(eh);
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, ExceptionSectionCorrectPlacement) {
......@@ -561,8 +557,7 @@ TEST_F(WasmModuleVerifyTest, ExceptionSectionAfterExport) {
FAIL_IF_NO_EXPERIMENTAL_EH(data);
WASM_FEATURE_SCOPE(eh);
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, ExceptionSectionBeforeImport) {
......@@ -570,8 +565,7 @@ TEST_F(WasmModuleVerifyTest, ExceptionSectionBeforeImport) {
FAIL_IF_NO_EXPERIMENTAL_EH(data);
WASM_FEATURE_SCOPE(eh);
ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_FALSE(result.ok());
EXPECT_FAILURE(data);
}
TEST_F(WasmModuleVerifyTest, ExceptionImport) {
......
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