|
|
@@ -41,6 +41,7 @@ func TestConn(t *testing.T, mp MakePipe) {
|
|
|
type connTester func(t *testing.T, c1, c2 net.Conn)
|
|
|
|
|
|
func timeoutWrapper(t *testing.T, mp MakePipe, f connTester) {
|
|
|
+ t.Helper()
|
|
|
c1, c2, stop, err := mp()
|
|
|
if err != nil {
|
|
|
t.Fatalf("unable to make pipe: %v", err)
|
|
|
@@ -390,6 +391,7 @@ func testConcurrentMethods(t *testing.T, c1, c2 net.Conn) {
|
|
|
// checkForTimeoutError checks that the error satisfies the Error interface
|
|
|
// and that Timeout returns true.
|
|
|
func checkForTimeoutError(t *testing.T, err error) {
|
|
|
+ t.Helper()
|
|
|
if nerr, ok := err.(net.Error); ok {
|
|
|
if !nerr.Timeout() {
|
|
|
t.Errorf("err.Timeout() = false, want true")
|
|
|
@@ -402,6 +404,7 @@ func checkForTimeoutError(t *testing.T, err error) {
|
|
|
// testRoundtrip writes something into c and reads it back.
|
|
|
// It assumes that everything written into c is echoed back to itself.
|
|
|
func testRoundtrip(t *testing.T, c net.Conn) {
|
|
|
+ t.Helper()
|
|
|
if err := c.SetDeadline(neverTimeout); err != nil {
|
|
|
t.Errorf("roundtrip SetDeadline error: %v", err)
|
|
|
}
|
|
|
@@ -423,6 +426,7 @@ func testRoundtrip(t *testing.T, c net.Conn) {
|
|
|
// It assumes that everything written into c is echoed back to itself.
|
|
|
// It assumes that 0xff is not currently on the wire or in the read buffer.
|
|
|
func resyncConn(t *testing.T, c net.Conn) {
|
|
|
+ t.Helper()
|
|
|
c.SetDeadline(neverTimeout)
|
|
|
errCh := make(chan error)
|
|
|
go func() {
|