1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00
hybridgroup.gobot/platforms/leap/leap_motion_driver_test.go

41 lines
802 B
Go
Raw Normal View History

2014-06-13 13:35:19 -07:00
package leap
import (
"github.com/hybridgroup/gobot"
"io/ioutil"
"testing"
)
var d *LeapMotionDriver
func init() {
d = NewLeapMotionDriver(NewLeapMotionAdaptor("bot", "/dev/null"), "bot")
}
func TestStart(t *testing.T) {
t.SkipNow()
gobot.Expect(t, d.Start(), true)
}
func TestHalt(t *testing.T) {
t.SkipNow()
gobot.Expect(t, d.Halt(), true)
}
func TestInit(t *testing.T) {
t.SkipNow()
gobot.Expect(t, d.Init(), true)
}
func TestParser(t *testing.T) {
file, _ := ioutil.ReadFile("./test/support/example_frame.json")
parsedFrame := d.ParseFrame(file)
if parsedFrame.Hands == nil || parsedFrame.Pointables == nil || parsedFrame.Gestures == nil {
t.Errorf("ParseFrame incorrectly parsed frame")
}
parsedFrame = d.ParseFrame([]byte{})
gobot.Expect(t, parsedFrame.Timestamp, 0)
}