Index: test/unittests/wasm/decoder-unittest.cc |
diff --git a/test/unittests/wasm/decoder-unittest.cc b/test/unittests/wasm/decoder-unittest.cc |
index 11d68f161eecfa32adf4faa2050cb329e1fff671..d773c955c0454e629d7ac501d02971a9352edc53 100644 |
--- a/test/unittests/wasm/decoder-unittest.cc |
+++ b/test/unittests/wasm/decoder-unittest.cc |
@@ -428,26 +428,6 @@ |
} |
} |
-TEST_F(DecoderTest, ReadI32v_extra_bits_negative) { |
- // OK for negative signed values to have extra ones. |
- int length = 0; |
- byte data[] = {0xff, 0xff, 0xff, 0xff, 0x7f}; |
- decoder.Reset(data, data + sizeof(data)); |
- decoder.checked_read_i32v(decoder.start(), 0, &length); |
- EXPECT_EQ(5, length); |
- EXPECT_TRUE(decoder.ok()); |
-} |
- |
-TEST_F(DecoderTest, ReadI32v_extra_bits_positive) { |
- // Not OK for positive signed values to have extra ones. |
- int length = 0; |
- byte data[] = {0x80, 0x80, 0x80, 0x80, 0x77}; |
- decoder.Reset(data, data + sizeof(data)); |
- decoder.checked_read_i32v(decoder.start(), 0, &length); |
- EXPECT_EQ(5, length); |
- EXPECT_FALSE(decoder.ok()); |
-} |
- |
TEST_F(DecoderTest, ReadU32v_Bits) { |
// A more exhaustive test. |
const int kMaxSize = 5; |
@@ -607,7 +587,8 @@ |
int length = 1 + i / 7; |
for (int j = 0; j < kMaxSize; j++) { |
- data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7); |
+ const uint64_t uval = bit_cast<uint64_t>(val); |
+ data[j] = static_cast<byte>((uval >> (7 * j)) & MASK_7); |
} |
for (int j = 0; j < length - 1; j++) { |
data[j] |= 0x80; |
@@ -642,26 +623,6 @@ |
} |
} |
-TEST_F(DecoderTest, ReadI64v_extra_bits_negative) { |
- // OK for negative signed values to have extra ones. |
- int length = 0; |
- byte data[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f}; |
- decoder.Reset(data, data + sizeof(data)); |
- decoder.checked_read_i64v(decoder.start(), 0, &length); |
- EXPECT_EQ(10, length); |
- EXPECT_TRUE(decoder.ok()); |
-} |
- |
-TEST_F(DecoderTest, ReadI64v_extra_bits_positive) { |
- // Not OK for positive signed values to have extra ones. |
- int length = 0; |
- byte data[] = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x77}; |
- decoder.Reset(data, data + sizeof(data)); |
- decoder.checked_read_i64v(decoder.start(), 0, &length); |
- EXPECT_EQ(10, length); |
- EXPECT_FALSE(decoder.ok()); |
-} |
- |
} // namespace wasm |
} // namespace internal |
} // namespace v8 |