2022-06-22 20:51:25 +01:00
|
|
|
package voicemeeter_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-06-25 01:03:08 +01:00
|
|
|
"github.com/stretchr/testify/assert"
|
2022-06-22 20:51:25 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestStrip0Mute(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[0].SetMute(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return true when SetMute(true)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.True(t, vmRem.Strip[0].GetMute())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[0].SetMute(false)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return false when SetMute(false)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.False(t, vmRem.Strip[0].GetMute())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestStrip2Limit(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[2].SetLimit(-8)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return -8 when SetLimit(-8)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[2].GetLimit(), -8)
|
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[2].SetLimit(-32)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return -32 when SetLimit(-8)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[2].GetLimit(), -32)
|
|
|
|
})
|
|
|
|
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestStrip4Label(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[4].SetLabel("test0")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return test0 when SetLimit('test0')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test0", vmRem.Strip[4].GetLabel())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[4].SetLabel("test1")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return test1 when SetLimit('test1')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test1", vmRem.Strip[4].GetLabel())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestStrip5Gain(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[4].SetGain(-20.8)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return -20.8 when SetGain(-20.8)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[4].GetGain(), -20.8)
|
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[4].SetGain(-3.6)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return -3.6 when SetGain(-3.6)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[4].GetGain(), -3.6)
|
|
|
|
})
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
2022-06-23 10:45:44 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
func TestStrip3Comp(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[4].SetComp(8.1)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-30 22:20:18 +01:00
|
|
|
t.Run("Should return 8.1 when SetGain(8.1)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[4].GetComp(), 8.1)
|
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[4].SetComp(1.6)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-30 22:20:18 +01:00
|
|
|
t.Run("Should return 1.6 when SetGain(1.6)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[4].GetComp(), 1.6)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-06-28 19:30:37 +01:00
|
|
|
func TestStrip5Mc(t *testing.T) {
|
2022-06-23 10:45:44 +01:00
|
|
|
//t.Skip("skipping test")
|
2022-06-28 19:30:37 +01:00
|
|
|
vmRem.Strip[5].SetMc(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return true when SetMc(true)", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.True(t, vmRem.Strip[5].GetMc())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
2022-06-28 19:30:37 +01:00
|
|
|
vmRem.Strip[5].SetMc(false)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return false when SetMc(false)", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.False(t, vmRem.Strip[5].GetMc())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestStrip2GainLayer3(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Strip[2].GainLayer()[3].Set(-18.3)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-28 19:30:37 +01:00
|
|
|
t.Run("Should return -18.3 when SetMc(true)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[2].GainLayer()[3].Get(), -18.3)
|
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Strip[2].GainLayer()[3].Set(-25.6)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-28 19:30:37 +01:00
|
|
|
t.Run("Should return -25.6 when SetMc(true)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Strip[2].GainLayer()[3].Get(), -25.6)
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-23 10:45:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBus3Eq(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
2022-06-25 01:03:08 +01:00
|
|
|
vmRem.Bus[3].SetEq(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return true when SetEq(true)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.True(t, vmRem.Bus[3].GetEq())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Bus[3].SetEq(false)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return false when SetEq(false)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.False(t, vmRem.Bus[3].GetEq())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-23 10:45:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBus4Label(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Bus[4].SetLabel("test0")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return test0 when SetEq('test0')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test0", vmRem.Bus[4].GetLabel())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Bus[4].SetLabel("test1")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return test1 when SetEq('test1')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test1", vmRem.Bus[4].GetLabel())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-23 10:45:44 +01:00
|
|
|
}
|
2022-06-23 14:07:36 +01:00
|
|
|
|
2022-06-28 17:32:03 +01:00
|
|
|
func TestBus3ModeAmix(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Bus[3].Mode().SetAmix(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-28 17:32:03 +01:00
|
|
|
t.Run("Should return true when Mode().SetAmix(true)", func(t *testing.T) {
|
|
|
|
assert.True(t, vmRem.Bus[3].Mode().GetAmix())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-06-23 14:07:36 +01:00
|
|
|
func TestVbanInStream0On(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Vban.InStream[0].SetOn(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return true when SetOn(true)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.True(t, vmRem.Vban.InStream[0].GetOn())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Vban.InStream[0].SetOn(false)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return false when SetOn(false)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.False(t, vmRem.Vban.InStream[0].GetOn())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-23 14:07:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestVbanOutStream6On(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Vban.OutStream[6].SetOn(true)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return true when SetOn(true)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.True(t, vmRem.Vban.OutStream[6].GetOn())
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Vban.OutStream[6].SetOn(false)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 01:03:08 +01:00
|
|
|
t.Run("Should return false when SetOn(false)", func(t *testing.T) {
|
2022-06-25 03:59:32 +01:00
|
|
|
assert.False(t, vmRem.Vban.OutStream[6].GetOn())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestVbanOutStream3Name(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
t.Skip("skipping test")
|
2022-06-25 03:59:32 +01:00
|
|
|
vmRem.Vban.OutStream[3].SetName("test0")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 03:59:32 +01:00
|
|
|
t.Run("Should return test0 when SetName('test0')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test0", vmRem.Vban.OutStream[3].GetName())
|
2022-06-25 03:59:32 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Vban.OutStream[3].SetName("test1")
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 03:59:32 +01:00
|
|
|
t.Run("Should return test1 when SetName('test1')", func(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
assert.Equal(t, "test1", vmRem.Vban.OutStream[3].GetName())
|
2022-06-25 03:59:32 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestVbanInStream4Bit(t *testing.T) {
|
2022-06-28 19:30:37 +01:00
|
|
|
t.Skip("skipping test")
|
2022-06-25 03:59:32 +01:00
|
|
|
t.Run("Should panic when instream SetBit(16)", func(t *testing.T) {
|
|
|
|
defer func() {
|
|
|
|
if r := recover(); r == nil {
|
|
|
|
t.Error("expected panic")
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
vmRem.Vban.InStream[4].SetBit(16)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestVbanOutStream4Bit(t *testing.T) {
|
|
|
|
//t.Skip("skipping test")
|
|
|
|
vmRem.Vban.OutStream[4].SetBit(16)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 03:59:32 +01:00
|
|
|
t.Run("Should return 16 when SetBit(16)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Vban.OutStream[4].GetBit(), 16)
|
|
|
|
})
|
|
|
|
|
|
|
|
vmRem.Vban.OutStream[4].SetBit(24)
|
2022-06-30 23:08:35 +01:00
|
|
|
sync()
|
2022-06-25 03:59:32 +01:00
|
|
|
t.Run("Should return 24 when SetBit(24)", func(t *testing.T) {
|
|
|
|
assert.Equal(t, vmRem.Vban.OutStream[4].GetBit(), 24)
|
2022-06-25 01:03:08 +01:00
|
|
|
})
|
2022-06-23 14:07:36 +01:00
|
|
|
}
|