Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
add unit test case for pkg/atomiccount/atomiccount_test.go
Browse files Browse the repository at this point in the history
Signed-off-by: ZouYu <[email protected]>
  • Loading branch information
zouy414 committed May 13, 2020
1 parent 6f632d8 commit 31497b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/atomiccount/atomiccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func (suite *AtomicCountUtilSuite) TestAdd(c *check.C) {

result := acount.Get()
c.Check(result, check.Equals, (int32)(12))

var nilAcount *AtomicInt
c.Check(nilAcount.Add(5), check.Equals, (int32)(0))
}

func (suite *AtomicCountUtilSuite) TestSet(c *check.C) {
Expand All @@ -49,4 +52,7 @@ func (suite *AtomicCountUtilSuite) TestSet(c *check.C) {
_ = acount.Set(1)
result := acount.Get()
c.Check(result, check.Equals, (int32)(1))

var nilAcount *AtomicInt
c.Check(nilAcount.Get(), check.Equals, (int32)(0))
}

0 comments on commit 31497b2

Please sign in to comment.