Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: test/unittests/wasm/module-decoder-unittest.cc

Issue 2772363002: Separate function decoding counter into asm and wasm counters. (Closed)
Patch Set: Create dummy module environment for DecodeWasmFunction test. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « src/wasm/wasm-module.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698