Fix tests

This commit is contained in:
Andy Wang 2020-04-10 16:14:32 +01:00
parent a51d45f41a
commit 78b27c0705
3 changed files with 7 additions and 20 deletions

View File

@ -15,7 +15,7 @@ func TestGenerateObfs(t *testing.T) {
var sessionKey [32]byte
rand.Read(sessionKey[:])
run := func(obfuscator *Obfuscator, ct *testing.T) {
run := func(obfuscator Obfuscator, ct *testing.T) {
obfsBuf := make([]byte, 512)
f := &Frame{}
_testFrame, _ := quick.Value(reflect.TypeOf(f), rand.New(rand.NewSource(42)))

View File

@ -10,14 +10,9 @@ import (
"time"
)
var seshConfigOrdered = SessionConfig{
Obfuscator: nil,
Valve: nil,
}
var seshConfigOrdered = SessionConfig{}
var seshConfigUnordered = SessionConfig{
Obfuscator: nil,
Valve: nil,
Unordered: true,
}

View File

@ -52,16 +52,12 @@ func TestSwitchboard_Send(t *testing.T) {
t.Run("Ordered", func(t *testing.T) {
seshConfig := SessionConfig{
Obfuscator: nil,
Valve: nil,
Unordered: false,
}
doTest(seshConfig)
})
t.Run("Unordered", func(t *testing.T) {
seshConfig := SessionConfig{
Obfuscator: nil,
Valve: nil,
Unordered: true,
}
doTest(seshConfig)
@ -70,10 +66,7 @@ func TestSwitchboard_Send(t *testing.T) {
func BenchmarkSwitchboard_Send(b *testing.B) {
hole := connutil.Discard()
seshConfig := SessionConfig{
Obfuscator: nil,
Valve: nil,
}
seshConfig := SessionConfig{}
sesh := MakeSession(0, seshConfig)
sesh.sb.addConn(hole)
connId, _, err := sesh.sb.pickRandConn()
@ -96,7 +89,6 @@ func BenchmarkSwitchboard_Send(b *testing.B) {
func TestSwitchboard_TxCredit(t *testing.T) {
seshConfig := SessionConfig{
Obfuscator: nil,
Valve: MakeValve(1<<20, 1<<20),
}
sesh := MakeSession(0, seshConfig)