diff options
Diffstat (limited to 'fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/go/wamr/runtime_test.go')
-rw-r--r-- | fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/go/wamr/runtime_test.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/go/wamr/runtime_test.go b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/go/wamr/runtime_test.go new file mode 100644 index 000000000..66fdf65e5 --- /dev/null +++ b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/go/wamr/runtime_test.go @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +package wamr + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestRuntime(t *testing.T) { + res := false + if (Runtime() != nil) { + res = true; + } + assert.Equal(t, res, true) + + err := Runtime().Init() + assert.NoError(t, err) + Runtime().Destroy() + + err = Runtime().FullInit(false, nil, 6) + assert.NoError(t, err) + Runtime().Destroy() + + err = Runtime().FullInit(false, nil, 0) + assert.NoError(t, err) + Runtime().Destroy() + + heap_buf := make([]byte, 128 * 1024) + err = Runtime().FullInit(true, heap_buf, 4) + assert.NoError(t, err) + Runtime().Destroy() + + Runtime().FullInit(false, nil, 0) + err = Runtime().FullInit(false, nil, 0) + assert.NoError(t, err) + Runtime().Destroy() + Runtime().Destroy() +} |