Skip to content

Commit

Permalink
core: update Audio platform to simply return error
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Nov 7, 2016
1 parent dfd8222 commit ec24ae5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions platforms/audio/audio_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func (a *Adaptor) Name() string { return a.name }

func (a *Adaptor) SetName(n string) { a.name = n }

func (a *Adaptor) Connect() []error { return nil }
func (a *Adaptor) Connect() error { return nil }

func (a *Adaptor) Finalize() []error { return nil }
func (a *Adaptor) Finalize() error { return nil }

func (a *Adaptor) Sound(fileName string) []error {
var errorsList []error
Expand Down
4 changes: 2 additions & 2 deletions platforms/audio/audio_adaptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var _ gobot.Adaptor = (*Adaptor)(nil)
func TestAudioAdaptor(t *testing.T) {
a := NewAdaptor()

gobottest.Assert(t, len(a.Connect()), 0)
gobottest.Assert(t, len(a.Finalize()), 0)
gobottest.Assert(t, a.Connect(), nil)
gobottest.Assert(t, a.Finalize(), nil)
}

func TestAudioAdaptorCommandsWav(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions platforms/audio/audio_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ func (d *Driver) adaptor() *Adaptor {
return d.Connection().(*Adaptor)
}

func (d *Driver) Start() (err []error) {
func (d *Driver) Start() (err error) {
return
}

func (d *Driver) Halt() (err []error) {
func (d *Driver) Halt() (err error) {
return
}
4 changes: 2 additions & 2 deletions platforms/audio/audio_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func TestAudioDriver(t *testing.T) {

gobottest.Refute(t, d.Connection(), nil)

gobottest.Assert(t, len(d.Start()), 0)
gobottest.Assert(t, d.Start(), nil)

gobottest.Assert(t, len(d.Halt()), 0)
gobottest.Assert(t, d.Halt(), nil)
}

func TestAudioDriverSoundWithNoFilename(t *testing.T) {
Expand Down

0 comments on commit ec24ae5

Please sign in to comment.