[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/1283054
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56702}
This commit is contained in:
Clemens Hammacher 2018-10-16 15:19:03 +02:00 committed by Commit Bot
parent 94850f5cc2
commit 9b8e034b5f

View File

@ -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) {