fix test cases

This commit is contained in:
Jae Kwon
2014-08-31 01:48:40 -07:00
parent fa382a3b05
commit a8ece216f0
9 changed files with 104 additions and 69 deletions

View File

@ -1,6 +1,7 @@
package p2p
import (
"encoding/hex"
"testing"
"time"
@ -89,7 +90,7 @@ func TestSwitches(t *testing.T) {
t.Errorf("Failed to receive from channel one")
}
if ReadString(inMsg.Bytes.Reader()) != "channel one" {
t.Errorf("Unexpected received message bytes: %X = [%v]", inMsg.Bytes, ReadString(inMsg.Bytes.Reader()))
t.Errorf("Unexpected received message bytes:\n%v", hex.Dump(inMsg.Bytes))
}
// Receive message from channel 0 and check
@ -98,7 +99,7 @@ func TestSwitches(t *testing.T) {
t.Errorf("Failed to receive from channel zero")
}
if ReadString(inMsg.Bytes.Reader()) != "channel zero" {
t.Errorf("Unexpected received message bytes: %X = [%v]", inMsg.Bytes, ReadString(inMsg.Bytes.Reader()))
t.Errorf("Unexpected received message bytes:\n%v", hex.Dump(inMsg.Bytes))
}
}