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 467ffcc2320d0c320532dbe31db53bdb03be545d..81816740fba5089e403e1690d0a25066785590f6 100644 |
--- a/test/unittests/wasm/module-decoder-unittest.cc |
+++ b/test/unittests/wasm/module-decoder-unittest.cc |
@@ -936,17 +936,17 @@ TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) { |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionNoLen) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionNoLen) { |
const byte data[] = { |
- kDeclWLL, // section without length. |
+ 0x5e, // misc section without length. |
}; |
EXPECT_FAILURE(data); |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionEmpty) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionEmpty) { |
static const byte data[] = { |
- kDeclWLL, 0, // empty section |
+ 0x5e, U32_LE(0), // misc empty section |
}; |
ModuleResult result = DecodeModule(data, data + arraysize(data)); |
EXPECT_TRUE(result.ok()); |
@@ -954,11 +954,11 @@ TEST_F(WasmModuleVerifyTest, WLLSectionEmpty) { |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionOne) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionOne) { |
static const byte data[] = { |
- kDeclWLL, |
- 1, // LEB128 1 |
- 0, // one byte section |
+ 0x5e, // misc section |
+ U32_LE(1), |
+ 0, // one byte section |
}; |
ModuleResult result = DecodeModule(data, data + arraysize(data)); |
EXPECT_TRUE(result.ok()); |
@@ -966,11 +966,11 @@ TEST_F(WasmModuleVerifyTest, WLLSectionOne) { |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionTen) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionTen) { |
static const byte data[] = { |
- kDeclWLL, |
- 10, // LEB128 10 |
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 10 byte section |
+ 0x5e, |
+ U32_LE(10), |
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 10 byte section |
}; |
ModuleResult result = DecodeModule(data, data + arraysize(data)); |
EXPECT_TRUE(result.ok()); |
@@ -978,30 +978,32 @@ TEST_F(WasmModuleVerifyTest, WLLSectionTen) { |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionOverflow) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionOverflow) { |
static const byte data[] = { |
- kDeclWLL, |
- 11, // LEB128 11 |
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 10 byte section |
+ 0x5e, |
+ U32_LE(11), |
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, // 10 byte section |
}; |
EXPECT_FAILURE(data); |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionUnderflow) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionUnderflow) { |
static const byte data[] = { |
- kDeclWLL, 0xff, 0xff, 0xff, 0xff, 0x0f, // LEB128 0xffffffff |
- 1, 2, 3, 4, // 4 byte section |
+ 0x5e, |
+ U32_LE(0xffffffff), |
+ 1, 2, 3, 4, // 4 byte section |
}; |
EXPECT_FAILURE(data); |
} |
-TEST_F(WasmModuleVerifyTest, WLLSectionLoop) { |
+TEST_F(WasmModuleVerifyTest, SkipSectionLoop) { |
// Would infinite loop decoding if wrapping and allowed. |
static const byte data[] = { |
- kDeclWLL, 0xfa, 0xff, 0xff, 0xff, 0x0f, // LEB128 0xfffffffa |
- 1, 2, 3, 4, // 4 byte section |
+ 0x5e, |
+ U32_LE(0xfffffffa), |
+ 1, 2, 3, 4, // 4 byte section |
}; |
EXPECT_FAILURE(data); |
} |