(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestCount64(t *testing.T) { |
| 34 | assert := assert.New(t) |
| 35 | |
| 36 | var value uint64 |
| 37 | var overflow bool |
| 38 | |
| 39 | c := counts.NewCount64(0) |
| 40 | value, overflow = c.ToUint64() |
| 41 | assert.Equalf(uint64(0), value, "NewCount64(0).ToUint64() should be 0") |
| 42 | assert.False(overflow, "NewCount64(0).ToUint64() does not overflow") |
| 43 | |
| 44 | c.Increment(counts.Count64(0xf000000000000000)) |
| 45 | value, overflow = c.ToUint64() |
| 46 | assert.Equalf(uint64(0xf000000000000000), value, "Count64(0xf000000000000000).ToUint64() value") |
| 47 | assert.False(overflow, "NewCount64(0xf000000000000000).ToUint64() does not overflow") |
| 48 | |
| 49 | c.Increment(counts.Count64(0xf000000000000000)) |
| 50 | value, overflow = c.ToUint64() |
| 51 | assert.Equalf(uint64(0xffffffffffffffff), value, "Count64(0xffffffffffffffff).ToUint64() value") |
| 52 | assert.True(overflow, "NewCount64(0xffffffffffffffff).ToUint64() overflows") |
| 53 | } |
nothing calls this directly
no test coverage detected