Skip to content

Commit

Permalink
fix uint64 transfer to int64
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid committed Sep 10, 2019
1 parent 066cb1d commit 4af1f42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions meta/autoid/autoid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package autoid_test

import (
"fmt"
"math"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -239,13 +240,12 @@ func (*testSuite) TestUnsignedAutoid(c *C) {
c.Assert(id, Equals, int64(6544))

// Test the MaxUint64 is alloc upper bound but not rebase.
var n uint64 = 18446744073709551614
var i interface{} = n
un := i.(int64)
var n uint64 = math.MaxInt64 - 1
un := int64(n)
err = alloc.Rebase(3, un, true)
c.Assert(err, IsNil)
_, err = alloc.Alloc(3)
c.Assert(alloc, NotNil)
un = int64(n + 1)
err = alloc.Rebase(3, un, true)
c.Assert(err, IsNil)
}
Expand Down

0 comments on commit 4af1f42

Please sign in to comment.