diff --git a/platforms/opencv/camera_driver_test.go b/platforms/opencv/camera_driver_test.go index 6794f9de..5eeed794 100644 --- a/platforms/opencv/camera_driver_test.go +++ b/platforms/opencv/camera_driver_test.go @@ -1,6 +1,7 @@ package opencv import ( + "strings" "testing" "time" @@ -25,6 +26,13 @@ func TestCameraDriver(t *testing.T) { gobottest.Assert(t, d.Connection(), (gobot.Connection)(nil)) } +func TestCameraDriverName(t *testing.T) { + d := initTestCameraDriver() + gobottest.Assert(t, strings.HasPrefix(d.Name(), "Camera"), true) + d.SetName("NewName") + gobottest.Assert(t, d.Name(), "NewName") +} + func TestCameraDriverStart(t *testing.T) { sem := make(chan bool) d := initTestCameraDriver() diff --git a/platforms/opencv/window_driver_test.go b/platforms/opencv/window_driver_test.go index 94a87f3c..6dfd82fe 100644 --- a/platforms/opencv/window_driver_test.go +++ b/platforms/opencv/window_driver_test.go @@ -3,6 +3,7 @@ package opencv import ( "path" "runtime" + "strings" "testing" cv "github.com/lazywei/go-opencv/opencv" @@ -23,6 +24,13 @@ func TestWindowDriver(t *testing.T) { gobottest.Assert(t, d.Connection(), (gobot.Connection)(nil)) } +func TestWindowDriverName(t *testing.T) { + d := initTestWindowDriver() + gobottest.Assert(t, strings.HasPrefix(d.Name(), "Window"), true) + d.SetName("NewName") + gobottest.Assert(t, d.Name(), "NewName") +} + func TestWindowDriverStart(t *testing.T) { d := initTestWindowDriver() gobottest.Assert(t, d.Start(), nil)