diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-19 15:56:43 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-20 03:41:07 -0800 |
commit | b7771896ec4a4d739428c39190ad0166b87d4e00 (patch) | |
tree | 28d0bb1c2394b578dc620563bf3cae20ebbb5bbd /table/table_test.go | |
parent | a6bb09a8478be3914f58d7b5a78daa9128cc64b2 (diff) |
table: export getNlri method in Path
peer codes need it. Also remove putNlri() because NLRI is unlikely
changed after path creation because NLRI is used as sorta key value
for path.
Diffstat (limited to 'table/table_test.go')
-rw-r--r-- | table/table_test.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/table/table_test.go b/table/table_test.go index 63ae026f..47213a82 100644 --- a/table/table_test.go +++ b/table/table_test.go @@ -41,13 +41,13 @@ func TestTableDeleteDestByNlri(t *testing.T) { pathT := TableCreatePath(msgT) ipv4t := NewIPv4Table(0) for _, path := range pathT { - tableKey := ipv4t.tableKey(path.getNlri()) - dest := ipv4t.createDest(path.getNlri()) + tableKey := ipv4t.tableKey(path.GetNlri()) + dest := ipv4t.createDest(path.GetNlri()) ipv4t.setDestination(tableKey.String(), dest) } - tableKey := ipv4t.tableKey(pathT[0].getNlri()) + tableKey := ipv4t.tableKey(pathT[0].GetNlri()) gdest := ipv4t.getDestination(tableKey.String()) - rdest := deleteDestByNlri(ipv4t, pathT[0].getNlri()) + rdest := deleteDestByNlri(ipv4t, pathT[0].GetNlri()) assert.Equal(t, rdest, gdest) } @@ -57,12 +57,12 @@ func TestTableDeleteDest(t *testing.T) { pathT := TableCreatePath(msgT) ipv4t := NewIPv4Table(0) for _, path := range pathT { - tableKey := ipv4t.tableKey(path.getNlri()) - dest := ipv4t.createDest(path.getNlri()) + tableKey := ipv4t.tableKey(path.GetNlri()) + dest := ipv4t.createDest(path.GetNlri()) ipv4t.setDestination(tableKey.String(), dest) } - tableKey := ipv4t.tableKey(pathT[0].getNlri()) - dest := ipv4t.createDest(pathT[0].getNlri()) + tableKey := ipv4t.tableKey(pathT[0].GetNlri()) + dest := ipv4t.createDest(pathT[0].GetNlri()) ipv4t.setDestination(tableKey.String(), dest) deleteDest(ipv4t, dest) gdest := ipv4t.getDestination(tableKey.String()) @@ -82,8 +82,8 @@ func TestTableSetDestinations(t *testing.T) { ipv4t := NewIPv4Table(0) destinations := make(map[string]Destination) for _, path := range pathT { - tableKey := ipv4t.tableKey(path.getNlri()) - dest := ipv4t.createDest(path.getNlri()) + tableKey := ipv4t.tableKey(path.GetNlri()) + dest := ipv4t.createDest(path.GetNlri()) destinations[tableKey.String()] = dest } ipv4t.setDestinations(destinations) @@ -97,8 +97,8 @@ func TestTableGetDestinations(t *testing.T) { ipv4t := NewIPv4Table(0) destinations := make(map[string]Destination) for _, path := range pathT { - tableKey := ipv4t.tableKey(path.getNlri()) - dest := ipv4t.createDest(path.getNlri()) + tableKey := ipv4t.tableKey(path.GetNlri()) + dest := ipv4t.createDest(path.GetNlri()) destinations[tableKey.String()] = dest } ipv4t.setDestinations(destinations) |