Skip to content

Commit

Permalink
Fix tests, again
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jul 28, 2014
1 parent 67a3fb8 commit 7148cf9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions protocol/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func TestPing(t *testing.T) {
ar, aw := io.Pipe()
br, bw := io.Pipe()

c0 := NewConnection(c0ID, ar, bw, nil, "name").(wireFormatConnection).next.(*rawConnection)
c1 := NewConnection(c1ID, br, aw, nil, "name").(wireFormatConnection).next.(*rawConnection)
c0 := NewConnection(c0ID, ar, bw, nil, "name", true).(wireFormatConnection).next.(*rawConnection)
c1 := NewConnection(c1ID, br, aw, nil, "name", true).(wireFormatConnection).next.(*rawConnection)

if ok := c0.ping(); !ok {
t.Error("c0 ping failed")
Expand All @@ -85,8 +85,8 @@ func TestPingErr(t *testing.T) {
eaw := &ErrPipe{PipeWriter: *aw, max: i, err: e}
ebw := &ErrPipe{PipeWriter: *bw, max: j, err: e}

c0 := NewConnection(c0ID, ar, ebw, m0, "name").(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, eaw, m1, "name")
c0 := NewConnection(c0ID, ar, ebw, m0, "name", true).(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, eaw, m1, "name", true)

res := c0.ping()
if (i < 8 || j < 8) && res {
Expand Down Expand Up @@ -161,8 +161,8 @@ func TestVersionErr(t *testing.T) {
ar, aw := io.Pipe()
br, bw := io.Pipe()

c0 := NewConnection(c0ID, ar, bw, m0, "name").(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name")
c0 := NewConnection(c0ID, ar, bw, m0, "name", true).(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name", true)

w := xdr.NewWriter(c0.cw)
w.WriteUint32(encodeHeader(header{
Expand All @@ -184,8 +184,8 @@ func TestTypeErr(t *testing.T) {
ar, aw := io.Pipe()
br, bw := io.Pipe()

c0 := NewConnection(c0ID, ar, bw, m0, "name").(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name")
c0 := NewConnection(c0ID, ar, bw, m0, "name", true).(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name", true)

w := xdr.NewWriter(c0.cw)
w.WriteUint32(encodeHeader(header{
Expand All @@ -207,8 +207,8 @@ func TestClose(t *testing.T) {
ar, aw := io.Pipe()
br, bw := io.Pipe()

c0 := NewConnection(c0ID, ar, bw, m0, "name").(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name")
c0 := NewConnection(c0ID, ar, bw, m0, "name", true).(wireFormatConnection).next.(*rawConnection)
NewConnection(c1ID, br, aw, m1, "name", true)

c0.close(nil)

Expand Down

0 comments on commit 7148cf9

Please sign in to comment.