From c495a3ab00bf2c656c6e9921741195503aa67137 Mon Sep 17 00:00:00 2001 From: Sir Darkrengarius Date: Sat, 15 Jun 2019 18:22:57 +0300 Subject: [PATCH] Change direct access to `ClientConn`s, `ServerConn`s to safe func call --- pkg/dmsg/server_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/dmsg/server_test.go b/pkg/dmsg/server_test.go index d114852ace..0b5dd1e0be 100644 --- a/pkg/dmsg/server_test.go +++ b/pkg/dmsg/server_test.go @@ -211,22 +211,22 @@ func TestServer_Serve(t *testing.T) { require.Equal(t, 2, s.connsCount()) // must have ServerConn for A - aServerConn, ok := s.conns[aPK] + aServerConn, ok := s.getConn(aPK) require.Equal(t, true, ok) require.Equal(t, aPK, aServerConn.remoteClient) // must have ServerConn for B - bServerConn, ok := s.conns[bPK] + bServerConn, ok := s.getConn(bPK) require.Equal(t, true, ok) require.Equal(t, bPK, bServerConn.remoteClient) // must have a ClientConn - aClientConn, ok := a.conns[sPK] + aClientConn, ok := a.getConn(sPK) require.Equal(t, true, ok) require.Equal(t, sPK, aClientConn.remoteSrv) // must have a ClientConn - bClientConn, ok := b.conns[sPK] + bClientConn, ok := b.getConn(sPK) require.Equal(t, true, ok) require.Equal(t, sPK, bClientConn.remoteSrv) @@ -408,24 +408,24 @@ func TestServer_Serve(t *testing.T) { for i, initiator := range initiators { // get and check initiator's ServerConn - initiatorServConn, ok := s.conns[initiator.pk] + initiatorServConn, ok := s.getConn(initiator.pk) require.Equal(t, true, ok) require.Equal(t, initiator.pk, initiatorServConn.remoteClient) // get and check initiator's ClientConn - initiatorClientConn, ok := initiator.conns[sPK] + initiatorClientConn, ok := initiator.getConn(sPK) require.Equal(t, true, ok) require.Equal(t, sPK, initiatorClientConn.remoteSrv) remote := remotes[pickedRemotes[i]] // get and check remote's ServerConn - remoteServConn, ok := s.conns[remote.pk] + remoteServConn, ok := s.getConn(remote.pk) require.Equal(t, true, ok) require.Equal(t, remote.pk, remoteServConn.remoteClient) // get and check remote's ClientConn - remoteClientConn, ok := remote.conns[sPK] + remoteClientConn, ok := remote.getConn(sPK) require.Equal(t, true, ok) require.Equal(t, sPK, remoteClientConn.remoteSrv)