2019-05-08 10:51:21 +03:00
|
|
|
package revid
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-05-15 09:27:49 +03:00
|
|
|
"bitbucket.org/ausocean/av/container/mts"
|
|
|
|
"bitbucket.org/ausocean/av/container/mts/meta"
|
2019-05-09 05:41:02 +03:00
|
|
|
"bitbucket.org/ausocean/iot/pi/netsender"
|
|
|
|
)
|
2019-05-08 10:51:21 +03:00
|
|
|
|
2019-05-15 09:27:49 +03:00
|
|
|
func TestAudioInputNew(t *testing.T) {
|
|
|
|
mts.Meta = meta.New()
|
2019-05-09 05:41:02 +03:00
|
|
|
var logger testLogger
|
|
|
|
ns, err := netsender.New(&logger, nil, nil, nil)
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("netsender.New failed with error %v", err)
|
|
|
|
}
|
2019-05-08 11:37:33 +03:00
|
|
|
|
2019-05-09 05:41:02 +03:00
|
|
|
var c Config
|
|
|
|
c.Logger = &logger
|
|
|
|
c.Input = Audio
|
2019-05-08 11:37:33 +03:00
|
|
|
|
2019-05-09 05:41:02 +03:00
|
|
|
rv, err := New(c, ns)
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("revid.New failed with error %v", err)
|
2019-05-15 09:27:49 +03:00
|
|
|
} else if rv == nil {
|
|
|
|
t.Errorf("revid.New did not return a new revid")
|
2019-05-09 05:41:02 +03:00
|
|
|
}
|
2019-05-08 11:37:33 +03:00
|
|
|
|
2019-05-15 09:27:49 +03:00
|
|
|
rv.Stop()
|
2019-05-08 10:51:21 +03:00
|
|
|
}
|