-
Notifications
You must be signed in to change notification settings - Fork 646
/
Copy pathruntime_test.go
42 lines (34 loc) · 919 Bytes
/
runtime_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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()
}