(r *responses, codes []int, t *testing.T)
| 78 | } |
| 79 | |
| 80 | func verifyResponseCodes(r *responses, codes []int, t *testing.T) { |
| 81 | if len(r.messages) != len(codes) { |
| 82 | t.Errorf("responses: expected %d, received %d.", len(codes), len(r.messages)) |
| 83 | } |
| 84 | for i := range codes { |
| 85 | resp := r.messages[i].(*ServerComMessage) |
| 86 | if resp == nil { |
| 87 | t.Fatalf("Response %d must be ServerComMessage", i) |
| 88 | } |
| 89 | if resp.Ctrl == nil { |
| 90 | t.Fatalf("Response %d must contain a ctrl message.", i) |
| 91 | } |
| 92 | if resp.Ctrl.Code != codes[i] { |
| 93 | t.Errorf("Response code: expected %d, got %d", codes[i], resp.Ctrl.Code) |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func TestDispatchInvalidVersion(t *testing.T) { |
| 99 | s := &Session{ |
no outgoing calls
no test coverage detected
searching dependent graphs…