(t *testing.T)
| 287 | } |
| 288 | |
| 289 | func TestTableKey(t *testing.T) { |
| 290 | tb := NewTable(logger, bgp.RF_IPv4_UC) |
| 291 | n1, _ := bgp.NewIPAddrPrefix(netip.MustParsePrefix("0.0.0.0/0")) |
| 292 | d1 := newDestination(n1, 0) |
| 293 | n2, _ := bgp.NewIPAddrPrefix(netip.MustParsePrefix("0.0.0.0/1")) |
| 294 | d2 := newDestination(n2, 0) |
| 295 | |
| 296 | assert.NotEqual(t, tableKey(d1.GetNlri()), tableKey(d2.GetNlri())) |
| 297 | tb.setDestination(d1) |
| 298 | tb.setDestination(d2) |
| 299 | assert.Equal(t, len(tb.GetDestinations()), 2) |
| 300 | } |
| 301 | |
| 302 | func BenchmarkTableKey(b *testing.B) { |
| 303 | rd := bgp.NewRouteDistinguisherTwoOctetAS(1, 2) |
nothing calls this directly
no test coverage detected
searching dependent graphs…