mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-01 13:48:57 +08:00
opencv: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
6bbf9989ed
commit
7f61b2d7dd
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user