diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-02-15 11:53:56 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-02-15 11:53:56 +0900 |
commit | 4e1edd39c2333af217d8972ad8c1b7b0556c93cc (patch) | |
tree | 64c2b0d6e1aca786d9921e640111ccf1007da9dc /server | |
parent | 9f6a0c501af7375a2c242869e249f72bc6ed5770 (diff) |
test: not rely on the type check auto conversion in assert.Equal
Diffstat (limited to 'server')
-rw-r--r-- | server/fsm_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/fsm_test.go b/server/fsm_test.go index 5a1feafa..ae31cc5a 100644 --- a/server/fsm_test.go +++ b/server/fsm_test.go @@ -145,8 +145,8 @@ func TestFSMHandlerOpensent_HoldTimerExpired(t *testing.T) { assert.Equal(bgp.BGP_FSM_IDLE, state) lastMsg := m.sendBuf[len(m.sendBuf)-1] sent, _ := bgp.ParseBGPMessage(lastMsg) - assert.Equal(bgp.BGP_MSG_NOTIFICATION, sent.Header.Type) - assert.Equal(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED, sent.Body.(*bgp.BGPNotification).ErrorCode) + assert.Equal(uint8(bgp.BGP_MSG_NOTIFICATION), sent.Header.Type) + assert.Equal(uint8(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED), sent.Body.(*bgp.BGPNotification).ErrorCode) } @@ -169,8 +169,8 @@ func TestFSMHandlerOpenconfirm_HoldTimerExpired(t *testing.T) { assert.Equal(bgp.BGP_FSM_IDLE, state) lastMsg := m.sendBuf[len(m.sendBuf)-1] sent, _ := bgp.ParseBGPMessage(lastMsg) - assert.Equal(bgp.BGP_MSG_NOTIFICATION, sent.Header.Type) - assert.Equal(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED, sent.Body.(*bgp.BGPNotification).ErrorCode) + assert.Equal(uint8(bgp.BGP_MSG_NOTIFICATION), sent.Header.Type) + assert.Equal(uint8(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED), sent.Body.(*bgp.BGPNotification).ErrorCode) } @@ -207,8 +207,8 @@ func TestFSMHandlerEstablish_HoldTimerExpired(t *testing.T) { assert.Equal(bgp.BGP_FSM_IDLE, state) lastMsg := m.sendBuf[len(m.sendBuf)-1] sent, _ := bgp.ParseBGPMessage(lastMsg) - assert.Equal(bgp.BGP_MSG_NOTIFICATION, sent.Header.Type) - assert.Equal(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED, sent.Body.(*bgp.BGPNotification).ErrorCode) + assert.Equal(uint8(bgp.BGP_MSG_NOTIFICATION), sent.Header.Type) + assert.Equal(uint8(bgp.BGP_ERROR_HOLD_TIMER_EXPIRED), sent.Body.(*bgp.BGPNotification).ErrorCode) } func makePeerAndHandler() (*Peer, *FSMHandler) { |