Index: test/unittests/wasm/module-decoder-unittest.cc |
diff --git a/test/unittests/wasm/module-decoder-unittest.cc b/test/unittests/wasm/module-decoder-unittest.cc |
index 3ad142bce0cc3eaae709a25d06b3a67bb5b43a44..dfd2a3c00c2269698efc064e526ec5dd28471110 100644 |
--- a/test/unittests/wasm/module-decoder-unittest.cc |
+++ b/test/unittests/wasm/module-decoder-unittest.cc |
@@ -919,7 +919,21 @@ TEST_F(WasmSignatureDecodeTest, Fail_invalid_param_type2) { |
EXPECT_EQ(nullptr, sig); |
} |
-class WasmFunctionVerifyTest : public TestWithIsolateAndZone {}; |
+class WasmFunctionVerifyTest : public TestWithIsolateAndZone { |
Karl
2017/03/28 01:53:16
Added class fields to implement a dummy instance o
|
+ public: |
+ WasmFunctionVerifyTest() |
+ : instance(&module), env(&module, &instance, bytes) {} |
+ virtual ~WasmFunctionVerifyTest() {} |
+ |
+ ModuleBytesEnv* get_env() { return &env; } |
+ |
+ private: |
+ WasmModule module; |
+ WasmInstance instance; |
+ Vector<const byte> bytes; |
+ ModuleBytesEnv env; |
+ DISALLOW_COPY_AND_ASSIGN(WasmFunctionVerifyTest); |
+}; |
TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) { |
static const byte data[] = { |
@@ -936,8 +950,8 @@ TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) { |
kExprEnd // body |
}; |
- FunctionResult result = |
- DecodeWasmFunction(isolate(), zone(), nullptr, data, data + sizeof(data)); |
+ FunctionResult result = DecodeWasmFunction(isolate(), zone(), get_env(), data, |
+ data + sizeof(data)); |
EXPECT_OK(result); |
if (result.val && result.ok()) { |