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

Unified Diff: test/unittests/wasm/encoder-unittest.cc

Issue 1536603003: Fix memory leaks and compiler incompatibilities in wasm unittests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years 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 | « no previous file | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/encoder-unittest.cc
diff --git a/test/unittests/wasm/encoder-unittest.cc b/test/unittests/wasm/encoder-unittest.cc
index b2a48eb3de2d5befcdff09c9dac246b5eea18dcf..156cf6b1e55e576692638828fb8cf0eb938c4ad9 100644
--- a/test/unittests/wasm/encoder-unittest.cc
+++ b/test/unittests/wasm/encoder-unittest.cc
@@ -24,8 +24,7 @@ class EncoderTest : public TestWithZone {
code.push_back(out_index.at(i));
}
uint32_t local_indices[] = {1};
- f->EmitCode(code.data(), static_cast<uint32_t>(code.size()), local_indices,
- 1);
+ f->EmitCode(&code[0], static_cast<uint32_t>(code.size()), local_indices, 1);
}
void CheckReadValue(uint8_t* leb_value, uint32_t expected_result,
@@ -45,7 +44,7 @@ class EncoderTest : public TestWithZone {
void CheckWriteValue(uint32_t input, int length, uint8_t* vals) {
const std::vector<uint8_t> result = UnsignedLEB128From(input);
CHECK_EQ(result.size(), length);
- for (size_t i = 0; i < length; i++) {
+ for (int i = 0; i < length; i++) {
CHECK_EQ(result.at(i), vals[i]);
}
}
@@ -83,7 +82,7 @@ TEST_F(EncoderTest, Function_Builder_Variable_Indexing) {
WasmFunctionEncoder* f = function->Build(&zone, builder);
ZoneVector<uint8_t> buffer_vector(f->HeaderSize() + f->BodySize(), &zone);
- byte* buffer = buffer_vector.data();
+ byte* buffer = &buffer_vector[0];
byte* header = buffer;
byte* body = buffer + f->HeaderSize();
f->Serialize(buffer, &header, &body);
@@ -105,7 +104,7 @@ TEST_F(EncoderTest, Function_Builder_Indexing_Variable_Width) {
WasmFunctionEncoder* f = function->Build(&zone, builder);
ZoneVector<uint8_t> buffer_vector(f->HeaderSize() + f->BodySize(), &zone);
- byte* buffer = buffer_vector.data();
+ byte* buffer = &buffer_vector[0];
byte* header = buffer;
byte* body = buffer + f->HeaderSize();
f->Serialize(buffer, &header, &body);
« no previous file with comments | « no previous file | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698