update the test assert and optimize the bench tests
This commit is contained in:
parent
e360f3d031
commit
7b320846c9
|
|
@ -339,13 +339,7 @@ func testBench() {
|
|||
return
|
||||
}
|
||||
|
||||
mip, err := xdb.IPMiddle(sip, eip)
|
||||
if err != nil {
|
||||
fmt.Printf("IPMiddle(%s,%s): %s", xdb.IP2String(sip), xdb.IP2String(eip), err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, ip := range [][]byte{sip, mip, eip} {
|
||||
for _, ip := range [][]byte{sip, eip} {
|
||||
sTime := time.Now()
|
||||
region, err := searcher.Search(ip)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -245,12 +245,12 @@ func TestConcurrentCall(t *testing.T) {
|
|||
}
|
||||
|
||||
if l := len(ipBytes); l == 4 {
|
||||
if region != "中国|广东省|深圳市|电信" {
|
||||
if region != "中国|广东省|深圳市|电信|CN" {
|
||||
fmt.Print("Error: region not equals")
|
||||
break
|
||||
}
|
||||
} else {
|
||||
if region != "中国|广东省|深圳市|家庭宽带" {
|
||||
if region != "中国|广东省|深圳市|电信|CN" {
|
||||
fmt.Print("Error: region not equals")
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue