From 9b1b801c8788b742052f2c274573501ccedba6fc Mon Sep 17 00:00:00 2001 From: sbruens Date: Fri, 20 Sep 2024 13:11:30 -0400 Subject: [PATCH] Update tests. --- service/tcp_test.go | 4 ++-- service/udp_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/tcp_test.go b/service/tcp_test.go index d287e43..e8f234f 100644 --- a/service/tcp_test.go +++ b/service/tcp_test.go @@ -102,7 +102,7 @@ func BenchmarkTCPFindCipherFail(b *testing.B) { } clientIP := clientConn.RemoteAddr().(*net.TCPAddr).AddrPort().Addr() b.StartTimer() - findAccessKey(clientConn, clientIP, cipherList, nil) + findAccessKey(clientConn, clientIP, cipherList, &noopLogger{}) b.StopTimer() } } @@ -205,7 +205,7 @@ func BenchmarkTCPFindCipherRepeat(b *testing.B) { cipher := cipherEntries[cipherNumber].CryptoKey go shadowsocks.NewWriter(writer, cipher).Write(makeTestPayload(50)) b.StartTimer() - _, _, _, _, err := findAccessKey(&c, clientIP, cipherList, nil) + _, _, _, _, err := findAccessKey(&c, clientIP, cipherList, &noopLogger{}) b.StopTimer() if err != nil { b.Error(err) diff --git a/service/udp_test.go b/service/udp_test.go index 1cf020e..0d62a02 100644 --- a/service/udp_test.go +++ b/service/udp_test.go @@ -409,7 +409,7 @@ func BenchmarkUDPUnpackFail(b *testing.B) { testIP := netip.MustParseAddr("192.0.2.1") b.ResetTimer() for n := 0; n < b.N; n++ { - findAccessKeyUDP(testIP, textBuf, testPayload, cipherList, nil) + findAccessKeyUDP(testIP, textBuf, testPayload, cipherList, &noopLogger{}) } } @@ -439,7 +439,7 @@ func BenchmarkUDPUnpackRepeat(b *testing.B) { cipherNumber := n % numCiphers ip := ips[cipherNumber] packet := packets[cipherNumber] - _, _, _, err := findAccessKeyUDP(ip, testBuf, packet, cipherList, nil) + _, _, _, err := findAccessKeyUDP(ip, testBuf, packet, cipherList, &noopLogger{}) if err != nil { b.Error(err) } @@ -468,7 +468,7 @@ func BenchmarkUDPUnpackSharedKey(b *testing.B) { b.ResetTimer() for n := 0; n < b.N; n++ { ip := ips[n%numIPs] - _, _, _, err := findAccessKeyUDP(ip, testBuf, packet, cipherList, nil) + _, _, _, err := findAccessKeyUDP(ip, testBuf, packet, cipherList, &noopLogger{}) if err != nil { b.Error(err) }