You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a test and it fails. I don't know why the variable result equals to 0.
String wat = /* a .wat file */;
@Test
public void myTest(){
Engine engine = new Engine();
Store store = new Store(engine);
Module module = new Module(engine,wat.getBytes(StandardCharsets.UTF_8));
Memory memory = new Memory(store,new MemoryType(new MemoryType.Limit(64)));
Linker linker = new Linker(store);
WasiConfig wasiConfig = new WasiConfig(new String[]{},new WasiConfig.PreopenDir[]{});
Wasi wasi = new Wasi(store,wasiConfig);
wasi.addToLinker(linker);
linker.define("env","memory",Extern.fromMemory(memory));
linker.module("a",module);
linker.getOneByName("a","_start").func().call();
int result = linker.getOneByName("a","get").func().call()[0].i32();
Assert.assertEquals(1,result); //failed, result==0
}
I have a test and it fails. I don't know why the variable
result
equals to 0.here is the .wat file:
this wat file is compiled from a c source code file with wasi-sdk:
@kawamuray Could please tell me why this happens? Thanks!
The text was updated successfully, but these errors were encountered: