Skip to content

Commit

Permalink
Update opencv window and camera tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Dec 19, 2014
1 parent 3ac4e82 commit 6e3bb51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 7 additions & 3 deletions platforms/opencv/camera_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ func initTestCameraDriver() *CameraDriver {
return d
}

func TestCameraDriver(t *testing.T) {
d := initTestCameraDriver()
gobot.Assert(t, d.Name(), "bot")
gobot.Assert(t, d.Connection(), (gobot.Connection)(nil))
}
func TestCameraDriverStart(t *testing.T) {
sem := make(chan bool)
d := initTestCameraDriver()
Expand All @@ -29,13 +34,12 @@ func TestCameraDriverStart(t *testing.T) {
t.Errorf("Event \"frame\" was not published")
}

}
func TestCameraDriver(t *testing.T) {
d := NewCameraDriver("bot", "")
d = NewCameraDriver("bot", "")
gobot.Assert(t, len(d.Start()), 0)

d = NewCameraDriver("bot", true)
gobot.Refute(t, len(d.Start()), 0)

}

func TestCameraDriverHalt(t *testing.T) {
Expand Down
8 changes: 5 additions & 3 deletions platforms/opencv/window_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (

func initTestWindowDriver() *WindowDriver {
d := NewWindowDriver("bot")
d.start = func(w *WindowDriver) {
w.window = &testWindow{}
}
return d
}

func TestWindowDriver(t *testing.T) {
d := initTestWindowDriver()
gobot.Assert(t, d.Name(), "bot")
gobot.Assert(t, d.Connection(), (gobot.Connection)(nil))
}
func TestWindowDriverStart(t *testing.T) {
d := initTestWindowDriver()
gobot.Assert(t, len(d.Start()), 0)
Expand Down

0 comments on commit 6e3bb51

Please sign in to comment.