fix tests

This commit is contained in:
Andrey Meshkov 2019-01-05 22:24:07 +03:00
parent f3a97ed7ab
commit c4ba284964
2 changed files with 2 additions and 1 deletions

View File

@ -122,7 +122,6 @@ func (s *Server) startInternal(config *ServerConfig) error {
go statsRotator() go statsRotator()
}) })
// TODO: Add TCPListenAddr
proxyConfig := proxy.Config{ proxyConfig := proxy.Config{
UDPListenAddr: s.UDPListenAddr, UDPListenAddr: s.UDPListenAddr,
TCPListenAddr: s.TCPListenAddr, TCPListenAddr: s.TCPListenAddr,

View File

@ -13,6 +13,7 @@ import (
func TestServer(t *testing.T) { func TestServer(t *testing.T) {
s := Server{} s := Server{}
s.UDPListenAddr = &net.UDPAddr{Port: 0} s.UDPListenAddr = &net.UDPAddr{Port: 0}
s.TCPListenAddr = &net.TCPAddr{Port: 0}
err := s.Start(nil) err := s.Start(nil)
if err != nil { if err != nil {
t.Fatalf("Failed to start server: %s", err) t.Fatalf("Failed to start server: %s", err)
@ -47,6 +48,7 @@ func TestServer(t *testing.T) {
func TestInvalidRequest(t *testing.T) { func TestInvalidRequest(t *testing.T) {
s := Server{} s := Server{}
s.UDPListenAddr = &net.UDPAddr{Port: 0} s.UDPListenAddr = &net.UDPAddr{Port: 0}
s.TCPListenAddr = &net.TCPAddr{Port: 0}
err := s.Start(nil) err := s.Start(nil)
if err != nil { if err != nil {
t.Fatalf("Failed to start server: %s", err) t.Fatalf("Failed to start server: %s", err)