summaryrefslogtreecommitdiffhomepage
path: root/table/table_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-02 00:16:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-02 00:16:33 +0900
commit07196197675c07c712eba0c24a934dcbe20783e4 (patch)
treef2f08f2606040b90e3f2abe2960f2160d4b93145 /table/table_test.go
parent15f598ad8e5be47725cc7aea31c80e38e346c408 (diff)
table: allocate bitmap for path id dynamically
allocating 256 bytes per prefix isn't a good idea. Let's allocate 8 bytes by default and expand dynamically if necessary. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_test.go')
-rw-r--r--table/table_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/table/table_test.go b/table/table_test.go
index bb51a4de..6f7c2ab4 100644
--- a/table/table_test.go
+++ b/table/table_test.go
@@ -28,7 +28,7 @@ func TestTableDeleteDestByNlri(t *testing.T) {
ipv4t := NewTable(bgp.RF_IPv4_UC)
for _, path := range pathT {
tableKey := ipv4t.tableKey(path.GetNlri())
- dest := NewDestination(path.GetNlri())
+ dest := NewDestination(path.GetNlri(), 0)
ipv4t.setDestination(tableKey, dest)
}
tableKey := ipv4t.tableKey(pathT[0].GetNlri())
@@ -43,11 +43,11 @@ func TestTableDeleteDest(t *testing.T) {
ipv4t := NewTable(bgp.RF_IPv4_UC)
for _, path := range pathT {
tableKey := ipv4t.tableKey(path.GetNlri())
- dest := NewDestination(path.GetNlri())
+ dest := NewDestination(path.GetNlri(), 0)
ipv4t.setDestination(tableKey, dest)
}
tableKey := ipv4t.tableKey(pathT[0].GetNlri())
- dest := NewDestination(pathT[0].GetNlri())
+ dest := NewDestination(pathT[0].GetNlri(), 0)
ipv4t.setDestination(tableKey, dest)
ipv4t.deleteDest(dest)
gdest := ipv4t.GetDestination(tableKey)
@@ -67,7 +67,7 @@ func TestTableSetDestinations(t *testing.T) {
destinations := make(map[string]*Destination)
for _, path := range pathT {
tableKey := ipv4t.tableKey(path.GetNlri())
- dest := NewDestination(path.GetNlri())
+ dest := NewDestination(path.GetNlri(), 0)
destinations[tableKey] = dest
}
ipv4t.setDestinations(destinations)
@@ -81,7 +81,7 @@ func TestTableGetDestinations(t *testing.T) {
destinations := make(map[string]*Destination)
for _, path := range pathT {
tableKey := ipv4t.tableKey(path.GetNlri())
- dest := NewDestination(path.GetNlri())
+ dest := NewDestination(path.GetNlri(), 0)
destinations[tableKey] = dest
}
ipv4t.setDestinations(destinations)