From b7771896ec4a4d739428c39190ad0166b87d4e00 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Fri, 19 Dec 2014 15:56:43 -0800 Subject: 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. --- table/table_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'table/table_test.go') 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) -- cgit v1.2.3