Commit 622780b1 authored by Tamir Duberstein's avatar Tamir Duberstein Committed by Brad Fitzpatrick

crypto/tls: don't log expected errors in test

This is minor cleanup that reduces test output noise.

Change-Id: Ib6db4daf8cb67b7784b2d5b222fa37c7f78a6a04
Reviewed-on: https://go-review.googlesource.com/19997Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 186d3e30
...@@ -518,16 +518,17 @@ func (test *serverTest) run(t *testing.T, write bool) { ...@@ -518,16 +518,17 @@ func (test *serverTest) run(t *testing.T, write bool) {
server := Server(serverConn, config) server := Server(serverConn, config)
connStateChan := make(chan ConnectionState, 1) connStateChan := make(chan ConnectionState, 1)
go func() { go func() {
var err error _, err := server.Write([]byte("hello, world\n"))
if _, err = server.Write([]byte("hello, world\n")); err != nil {
t.Logf("Error from Server.Write: %s", err)
}
if len(test.expectHandshakeErrorIncluding) > 0 { if len(test.expectHandshakeErrorIncluding) > 0 {
if err == nil { if err == nil {
t.Errorf("Error expected, but no error returned") t.Errorf("Error expected, but no error returned")
} else if s := err.Error(); !strings.Contains(s, test.expectHandshakeErrorIncluding) { } else if s := err.Error(); !strings.Contains(s, test.expectHandshakeErrorIncluding) {
t.Errorf("Error expected containing '%s' but got '%s'", test.expectHandshakeErrorIncluding, s) t.Errorf("Error expected containing '%s' but got '%s'", test.expectHandshakeErrorIncluding, s)
} }
} else {
if err != nil {
t.Logf("Error from Server.Write: '%s'", err)
}
} }
server.Close() server.Close()
serverConn.Close() serverConn.Close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment