p2p: fix switch_test to account for handshake

This commit is contained in:
Ethan Buchman 2015-03-17 22:20:30 -07:00 committed by Jae Kwon
parent 4abca6e963
commit 65a232bd9d
1 changed files with 2 additions and 2 deletions

View File

@ -141,10 +141,10 @@ func TestSwitches(t *testing.T) {
// Check message on ch0 // Check message on ch0
ch0Msgs := s2.Reactors()[0].(*TestReactor).msgsReceived[byte(0x00)] ch0Msgs := s2.Reactors()[0].(*TestReactor).msgsReceived[byte(0x00)]
if len(ch0Msgs) != 1 { if len(ch0Msgs) != 2 {
t.Errorf("Expected to have received 1 message in ch0") t.Errorf("Expected to have received 1 message in ch0")
} }
if !bytes.Equal(ch0Msgs[0].Bytes, binary.BinaryBytes(ch0Msg)) { if !bytes.Equal(ch0Msgs[1].Bytes, binary.BinaryBytes(ch0Msg)) {
t.Errorf("Unexpected message bytes. Wanted: %X, Got: %X", binary.BinaryBytes(ch0Msg), ch0Msgs[0].Bytes) t.Errorf("Unexpected message bytes. Wanted: %X, Got: %X", binary.BinaryBytes(ch0Msg), ch0Msgs[0].Bytes)
} }