mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-15 17:40:51 +00:00
float/string getter/setter tests added
test helper added
This commit is contained in:
parent
87a05d81e4
commit
dd895daffb
24
helper_test.go
Normal file
24
helper_test.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package voicemeeter
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
vm = NewRemote("potato")
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
vm.Login()
|
||||||
|
code := m.Run()
|
||||||
|
vm.Logout()
|
||||||
|
os.Exit(code)
|
||||||
|
}
|
||||||
|
|
||||||
|
func sync() {
|
||||||
|
time.Sleep(30 * time.Millisecond)
|
||||||
|
for vm.Pdirty() || vm.Mdirty() {
|
||||||
|
}
|
||||||
|
}
|
@ -83,3 +83,24 @@ func TestGetPotatoRemote(t *testing.T) {
|
|||||||
assert.NotNil(t, __rem.Recorder)
|
assert.NotNil(t, __rem.Recorder)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSetAndGetFloatParameter(t *testing.T) {
|
||||||
|
//t.Skip("skipping test")
|
||||||
|
var param = "strip[0].mute"
|
||||||
|
vm.SetFloat(param, 1)
|
||||||
|
sync()
|
||||||
|
t.Run("Should get a float parameter", func(t *testing.T) {
|
||||||
|
assert.Equal(t, float64(1), vm.GetFloat(param))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSetAndGetStringParameter(t *testing.T) {
|
||||||
|
//t.Skip("skipping test")
|
||||||
|
var param = "strip[0].label"
|
||||||
|
var val = "test0"
|
||||||
|
vm.SetString(param, val)
|
||||||
|
sync()
|
||||||
|
t.Run("Should get a string parameter", func(t *testing.T) {
|
||||||
|
assert.Equal(t, val, vm.GetString(param))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user