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

Unified Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 2406133003: [wasm] Decouple function name and exported name in WasmFunctionBuilder (Closed)
Patch Set: Change interface to Vector<const char>; avoids size_t/int confusion Created 4 years, 2 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-builder.cc ('k') | test/fuzzer/wasm-code.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-module.cc
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc
index b4c271fa5b1da99937b51266fa6d725e17d4142e..8a45955b8dafd9b5e4b500ce905f71ffe3396b27 100644
--- a/test/cctest/wasm/test-run-wasm-module.cc
+++ b/test/cctest/wasm/test-run-wasm-module.cc
@@ -48,15 +48,7 @@ void TestModuleException(Zone* zone, WasmModuleBuilder* builder) {
isolate->clear_pending_exception();
}
-void ExportAs(WasmFunctionBuilder* f, const char* name) {
- f->SetExported();
- f->SetName(name, static_cast<int>(strlen(name)));
-}
-
-void ExportAsMain(WasmFunctionBuilder* f) {
- static const char kMainName[] = "main";
- ExportAs(f, kMainName);
-}
+void ExportAsMain(WasmFunctionBuilder* f) { f->ExportAs(CStrVector("main")); }
} // namespace
@@ -190,7 +182,7 @@ TEST(Run_WasmModule_Serialization) {
WasmFunctionBuilder* f = builder->AddFunction(sigs.i_i());
byte code[] = {WASM_GET_LOCAL(0), kExprI32Const, 1, kExprI32Add};
f->EmitCode(code, sizeof(code));
- ExportAs(f, kFunctionName);
+ f->ExportAs(CStrVector(kFunctionName));
ZoneBuffer buffer(&zone);
builder->WriteTo(buffer);
« no previous file with comments | « src/wasm/wasm-module-builder.cc ('k') | test/fuzzer/wasm-code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698