Skip to content
Snippets Groups Projects
Commit 05e22e1a authored by Oliver Herms's avatar Oliver Herms
Browse files

More tests

parent 395888c8
No related branches found
No related tags found
No related merge requests found
......@@ -16,11 +16,6 @@ func (im *InitiationMessage) MsgType() uint8 {
return im.CommonHeader.MsgType
}
// SetCommonHeader sets the common header
func (im *InitiationMessage) SetCommonHeader(ch *CommonHeader) {
im.CommonHeader = ch
}
func decodeInitiationMessage(buf *bytes.Buffer, ch *CommonHeader) (Msg, error) {
im := &InitiationMessage{
TLVs: make([]*InformationTLV, 0, 2),
......
......@@ -7,6 +7,17 @@ import (
"github.com/stretchr/testify/assert"
)
func TestInitiationMessageMsgType(t *testing.T) {
pd := &InitiationMessage{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodeInitiationMessage(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,18 @@ import (
"github.com/stretchr/testify/assert"
)
func TestPeerDownMsgType(t *testing.T) {
pd := &PeerDownNotification{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodePeerDownNotification(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,17 @@ import (
"github.com/stretchr/testify/assert"
)
func TestPeerUpMsgType(t *testing.T) {
pd := &PeerUpNotification{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodePeerUp(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,17 @@ import (
"github.com/stretchr/testify/assert"
)
func TestRouteMirrorType(t *testing.T) {
pd := &RouteMirroringMsg{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodeRouteMirroringMsg(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,17 @@ import (
"github.com/stretchr/testify/assert"
)
func TestRouteMonitoringMsgType(t *testing.T) {
pd := &RouteMonitoringMsg{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodeRouteMonitoringMsg(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,18 @@ import (
"github.com/stretchr/testify/assert"
)
func TestStatsReportMsgType(t *testing.T) {
pd := &StatsReport{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodeStatsReport(t *testing.T) {
tests := []struct {
name string
......
......@@ -7,6 +7,17 @@ import (
"github.com/stretchr/testify/assert"
)
func TestTerminationMessageType(t *testing.T) {
pd := &TerminationMessage{
CommonHeader: &CommonHeader{
MsgType: 100,
},
}
if pd.MsgType() != 100 {
t.Errorf("Unexpected result")
}
}
func TestDecodeTerminationMessage(t *testing.T) {
tests := []struct {
name string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment