diff options
Diffstat (limited to 'packet/mrt_test.go')
-rw-r--r-- | packet/mrt_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packet/mrt_test.go b/packet/mrt_test.go index c43d45e0..11a233ec 100644 --- a/packet/mrt_test.go +++ b/packet/mrt_test.go @@ -41,6 +41,17 @@ func TestMrtHdr(t *testing.T) { assert.Equal(t, reflect.DeepEqual(h1, h2), true) } +func TestMrtHdrTime(t *testing.T) { + h1, err := NewMRTHeader(10, TABLE_DUMPv2, RIB_IPV4_MULTICAST, 20) + if err != nil { + t.Fatal(err) + } + ttime := time.Unix(10, 0) + htime := h1.GetTime() + t.Logf("this timestamp should be 10s after epoch:%v", htime) + assert.Equal(t, h1.GetTime(), ttime) +} + func testPeer(t *testing.T, p1 *Peer) { b1, err := p1.Serialize() if err != nil { |