-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
45 lines (37 loc) · 1.05 KB
/
main_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
43
44
45
package acctelemetry_test
import (
"fmt"
"testing"
"time"
"github.com/sparkoo/acctelemetry-go"
)
func TestTelemetry(t *testing.T) {
telemetry := acctelemetry.New(acctelemetry.DefaultConfig())
defer telemetry.Close()
err := telemetry.Connect()
if err != nil {
t.Error(fmt.Errorf("unable to connect to ACC: %w\n", err))
}
fmt.Printf("Static: %+v\n\n", telemetry.StaticPointer())
fmt.Printf("Graphics: %+v\n\n", telemetry.GraphicsPointer())
fmt.Printf("Physics: %+v\n\n", telemetry.PhysicsPointer())
time.Sleep(10 * time.Second)
fmt.Printf("Static: %+v\n\n", telemetry.StaticPointer())
fmt.Printf("Graphics: %+v\n\n", telemetry.GraphicsPointer())
fmt.Printf("Physics: %+v\n\n", telemetry.PhysicsPointer())
}
func TestUdp(t *testing.T) {
telemetry := acctelemetry.New(acctelemetry.DefaultUdpConfig())
defer telemetry.Close()
if err := telemetry.Connect(); err != nil {
fmt.Printf("%+v\n", err)
}
t.Fail()
}
func convertToString(chars []uint16) string {
var str string
for _, val := range chars {
str += string(rune(val))
}
return str
}