(i int, sw *Switch)
| 114 | } |
| 115 | |
| 116 | func initSwitchFunc(i int, sw *Switch) *Switch { |
| 117 | sw.SetAddrBook(&AddrBookMock{ |
| 118 | Addrs: make(map[string]struct{}), |
| 119 | OurAddrs: make(map[string]struct{}), |
| 120 | }) |
| 121 | |
| 122 | // Make two reactors of two channels each |
| 123 | sw.AddReactor("foo", NewTestReactor([]*conn.ChannelDescriptor{ |
| 124 | {ID: byte(0x00), Priority: 10, MessageType: &p2pproto.Message{}}, |
| 125 | {ID: byte(0x01), Priority: 10, MessageType: &p2pproto.Message{}}, |
| 126 | }, true)) |
| 127 | sw.AddReactor("bar", NewTestReactor([]*conn.ChannelDescriptor{ |
| 128 | {ID: byte(0x02), Priority: 10, MessageType: &p2pproto.Message{}}, |
| 129 | {ID: byte(0x03), Priority: 10, MessageType: &p2pproto.Message{}}, |
| 130 | }, true)) |
| 131 | |
| 132 | return sw |
| 133 | } |
| 134 | |
| 135 | func TestSwitches(t *testing.T) { |
| 136 | s1, s2 := MakeSwitchPair(t, initSwitchFunc) |
no test coverage detected