summaryrefslogtreecommitdiffhomepage
path: root/table/policy_test.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-12 14:18:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-24 08:18:50 +0900
commit549b7037381ec51d0c5b9a0abbe8f73000fda70c (patch)
tree40ed8a74f1b75990071b79e363e331887e7db51e /table/policy_test.go
parentb391322bcbf56d623ca0a6b667c026b92f1e9e4d (diff)
*: Use strconv.ParseUint instead of strconv.Atoi()
For the 32-bit platform compatibility. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'table/policy_test.go')
-rw-r--r--table/policy_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/table/policy_test.go b/table/policy_test.go
index c55eb1c8..cf02b095 100644
--- a/table/policy_test.go
+++ b/table/policy_test.go
@@ -24,10 +24,11 @@ import (
"testing"
"time"
- "github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet/bgp"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
+
+ "github.com/osrg/gobgp/config"
+ "github.com/osrg/gobgp/packet/bgp"
)
func TestPrefixCalcurateNoRange(t *testing.T) {
@@ -2800,9 +2801,9 @@ func createNeighborSet(name string, addr string) config.NeighborSet {
func createAs4Value(s string) uint32 {
v := strings.Split(s, ".")
- upper, _ := strconv.Atoi(v[0])
- lower, _ := strconv.Atoi(v[1])
- return uint32(upper)<<16 + uint32(lower)
+ upper, _ := strconv.ParseUint(v[0], 10, 16)
+ lower, _ := strconv.ParseUint(v[1], 10, 16)
+ return uint32(upper<<16 | lower)
}
func TestPrefixSetOperation(t *testing.T) {