Fixed tests

This commit is contained in:
Milos Gajdos 2020-01-14 18:22:58 +00:00
parent 821fda41ae
commit 0ea56a5ffe
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -21,7 +21,7 @@ func testSetup() *node {
address: testNodeAddress, address: testNodeAddress,
peers: make(map[string]*node), peers: make(map[string]*node),
network: newNetwork(Name(testNodeNetName)), network: newNetwork(Name(testNodeNetName)),
err: new(nodeError), status: newStatus(),
} }
// add some peers to the node // add some peers to the node
@ -31,7 +31,7 @@ func testSetup() *node {
address: testNode.address + "-" + id, address: testNode.address + "-" + id,
peers: make(map[string]*node), peers: make(map[string]*node),
network: testNode.network, network: testNode.network,
err: new(nodeError), status: newStatus(),
} }
} }
@ -43,7 +43,7 @@ func testSetup() *node {
address: testNode.address + "-" + id, address: testNode.address + "-" + id,
peers: make(map[string]*node), peers: make(map[string]*node),
network: testNode.network, network: testNode.network,
err: new(nodeError), status: newStatus(),
} }
} }
@ -272,7 +272,9 @@ func TestUnpackPeerTopology(t *testing.T) {
Node: &pb.Node{ Node: &pb.Node{
Id: "newPeer", Id: "newPeer",
Address: "newPeerAddress", Address: "newPeerAddress",
Err: &pb.NodeError{}, Status: &pb.Status{
Error: &pb.Error{},
},
}, },
Peers: make([]*pb.Peer, 0), Peers: make([]*pb.Peer, 0),
} }
@ -288,14 +290,18 @@ func TestUnpackPeerTopology(t *testing.T) {
pbPeer1Node := &pb.Node{ pbPeer1Node := &pb.Node{
Id: peer1.id, Id: peer1.id,
Address: peer1.address, Address: peer1.address,
Err: &pb.NodeError{}, Status: &pb.Status{
Error: &pb.Error{},
},
} }
pbPeer111 := &pb.Peer{ pbPeer111 := &pb.Peer{
Node: &pb.Node{ Node: &pb.Node{
Id: "peer111", Id: "peer111",
Address: "peer111Address", Address: "peer111Address",
Err: &pb.NodeError{}, Status: &pb.Status{
Error: &pb.Error{},
},
}, },
Peers: make([]*pb.Peer, 0), Peers: make([]*pb.Peer, 0),
} }
@ -304,7 +310,9 @@ func TestUnpackPeerTopology(t *testing.T) {
Node: &pb.Node{ Node: &pb.Node{
Id: "peer121", Id: "peer121",
Address: "peer121Address", Address: "peer121Address",
Err: &pb.NodeError{}, Status: &pb.Status{
Error: &pb.Error{},
},
}, },
Peers: make([]*pb.Peer, 0), Peers: make([]*pb.Peer, 0),
} }
@ -331,7 +339,7 @@ func TestPeersToProto(t *testing.T) {
address: testNodeAddress, address: testNodeAddress,
peers: make(map[string]*node), peers: make(map[string]*node),
network: newNetwork(Name(testNodeNetName)), network: newNetwork(Name(testNodeNetName)),
err: &nodeError{}, status: newStatus(),
} }
topCount := 0 topCount := 0