1
0
Fork 0

Adjust tests to use the logger config option

logger
svent 2015-09-07 02:19:34 +02:00
parent 1b0ce4078f
commit 05a64adbf8
2 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,9 @@ import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"io" "io"
"log"
"net" "net"
"os"
"strings" "strings"
"testing" "testing"
) )
@ -50,6 +52,7 @@ func TestRequest_Connect(t *testing.T) {
s := &Server{config: &Config{ s := &Server{config: &Config{
Rules: PermitAll(), Rules: PermitAll(),
Resolver: DNSResolver{}, Resolver: DNSResolver{},
Logger: log.New(os.Stdout, "", log.LstdFlags),
}} }}
// Create the connect request // Create the connect request
@ -119,6 +122,7 @@ func TestRequest_Connect_RuleFail(t *testing.T) {
s := &Server{config: &Config{ s := &Server{config: &Config{
Rules: PermitNone(), Rules: PermitNone(),
Resolver: DNSResolver{}, Resolver: DNSResolver{},
Logger: log.New(os.Stdout, "", log.LstdFlags),
}} }}
// Create the connect request // Create the connect request

View File

@ -4,7 +4,9 @@ import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"io" "io"
"log"
"net" "net"
"os"
"testing" "testing"
"time" "time"
) )
@ -38,9 +40,10 @@ func TestSOCKS5_Connect(t *testing.T) {
creds := StaticCredentials{ creds := StaticCredentials{
"foo": "bar", "foo": "bar",
} }
cator := UserPassAuthenticator{Credentials : creds} cator := UserPassAuthenticator{Credentials: creds}
conf := &Config{ conf := &Config{
AuthMethods : []Authenticator{cator}, AuthMethods: []Authenticator{cator},
Logger: log.New(os.Stdout, "", log.LstdFlags),
} }
serv, err := New(conf) serv, err := New(conf)
if err != nil { if err != nil {