Skip to content

Commit

Permalink
core: correct behavior in Mavlink driver, correct tests to match
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Sep 12, 2016
1 parent 3a60b33 commit 0c6bd6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion platforms/gpio/button_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

var _ gobot.Driver = (*ButtonDriver)(nil)

const BUTTON_TEST_DELAY = 50
const BUTTON_TEST_DELAY = 150

func initTestButtonDriver() *ButtonDriver {
return NewButtonDriver(newGpioTestAdaptor("adaptor"), "bot", "1")
Expand Down
8 changes: 4 additions & 4 deletions platforms/mavlink/mavlink_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
)

const (
// Packet event
// PacketEvent event
PacketEvent = "packet"
// Message event
// MessageEvent event
MessageEvent = "message"
// ErrorIO event
// ErrorIOE event
ErrorIOEvent = "errorIO"
// ErrorMAVLink event
// ErrorMAVLinkEvent event
ErrorMAVLinkEvent = "errorMAVLink"
)

Expand Down
8 changes: 4 additions & 4 deletions platforms/mavlink/mavlink_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ func TestMavlinkDriverStart(t *testing.T) {
packet := make(chan *common.MAVLinkPacket, 0)
message := make(chan common.MAVLinkMessage, 0)

d.Once(d.Event("packet"), func(data interface{}) {
d.On(PacketEvent, func(data interface{}) {
packet <- data.(*common.MAVLinkPacket)
})
d.Once(d.Event("message"), func(data interface{}) {
d.On(MessageEvent, func(data interface{}) {
message <- data.(common.MAVLinkMessage)
})
d.Once(d.Event("errorIO"), func(data interface{}) {
d.On(ErrorIOEvent, func(data interface{}) {
err <- data.(error)
})
d.Once(d.Event("errorMAVLink"), func(data interface{}) {
d.On(ErrorMAVLinkEvent, func(data interface{}) {
err <- data.(error)
})

Expand Down

0 comments on commit 0c6bd6d

Please sign in to comment.