diff --git a/codec/cbor_test.go b/codec/cbor_test.go index 611ddffd..12f5c810 100644 --- a/codec/cbor_test.go +++ b/codec/cbor_test.go @@ -149,7 +149,7 @@ func TestCborGoldens(t *testing.T) { } bs, err := hex.DecodeString(g.Hex) if err != nil { - logT(t, "[%v] error hex decoding %s [%v]: %v", i, g.Hex, err) + logT(t, "[%v] error hex decoding %s [%v]: %v", i, g.Hex, g.Hex, err) failT(t) } var v interface{} diff --git a/codec/codec_test.go b/codec/codec_test.go index 3754abcd..d02feacd 100644 --- a/codec/codec_test.go +++ b/codec/codec_test.go @@ -1169,10 +1169,12 @@ func testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs // } if atomic.LoadUint64(&serverExitFlag) == 1 { serverExitChan <- true - conn1.Close() + if conn1 != nil { + conn1.Close() + } return // exit serverFn goroutine } - if err1 == nil { + if err1 == nil && conn1 != nil { sc := rr.ServerCodec(testReadWriteCloser(conn1), h) srv.ServeCodec(sc) }