MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestNewP2PServer

Function TestNewP2PServer

p2pserver/p2pserver_test.go:37–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35
36}
37func TestNewP2PServer(t *testing.T) {
38 fmt.Println("Start test new p2pserver...")
39
40 p2p := NewServer()
41
42 if p2p.GetVersion() != common.PROTOCOL_VERSION {
43 t.Error("TestNewP2PServer p2p version error", p2p.GetVersion())
44 }
45
46 if p2p.GetVersion() != common.PROTOCOL_VERSION {
47 t.Error("TestNewP2PServer p2p version error")
48 }
49 sync := p2p.GetPort()
50 if sync != 20338 {
51 t.Error("TestNewP2PServer sync port error")
52 }
53}

Callers

nothing calls this directly

Calls 4

NewServerFunction · 0.85
GetVersionMethod · 0.65
ErrorMethod · 0.65
GetPortMethod · 0.65

Tested by

no test coverage detected