MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / TestFuncWrapSimpleManyArg

Function TestFuncWrapSimpleManyArg

func_test.go:164–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

162}
163
164func TestFuncWrapSimpleManyArg(t *testing.T) {
165 store := NewStore(NewEngine())
166 f := WrapFunc(store, func(i1 int32, i2 int64, f1 float32, f2 float64) {
167 if i1 != 3 {
168 panic("wrong argument")
169 }
170 if i2 != 4 {
171 panic("wrong argument")
172 }
173 if f1 != 5 {
174 panic("wrong argument")
175 }
176 if f2 != 6 {
177 panic("wrong argument")
178 }
179 })
180 result, trap := f.Call(store, 3, 4, float32(5.0), float64(6.0))
181 require.Nil(t, trap)
182 require.Nil(t, result)
183}
184
185func TestFuncWrapCallerArg(t *testing.T) {
186 store := NewStore(NewEngine())

Callers

nothing calls this directly

Calls 4

NewStoreFunction · 0.85
NewEngineFunction · 0.85
WrapFuncFunction · 0.85
CallMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…