core: update Audio platform to simply return error

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2016-11-07 17:27:49 +01:00
parent dfd822251e
commit ec24ae58bc
4 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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
}

View File

@ -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) {