(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestCount32(t *testing.T) { |
| 12 | assert := assert.New(t) |
| 13 | |
| 14 | var value uint64 |
| 15 | var overflow bool |
| 16 | |
| 17 | c := counts.NewCount32(0) |
| 18 | value, overflow = c.ToUint64() |
| 19 | assert.Equalf(uint64(0), value, "NewCount32(0).ToUint64() should be 0") |
| 20 | assert.False(overflow, "NewCount32(0).ToUint64() does not overflow") |
| 21 | |
| 22 | c.Increment(counts.Count32(0xf0000000)) |
| 23 | value, overflow = c.ToUint64() |
| 24 | assert.Equalf(uint64(0xf0000000), value, "Count32(0xf0000000).ToUint64() value") |
| 25 | assert.False(overflow, "NewCount32(0xf0000000).ToUint64() does not overflow") |
| 26 | |
| 27 | c.Increment(counts.Count32(0xf0000000)) |
| 28 | value, overflow = c.ToUint64() |
| 29 | assert.Equalf(uint64(0xffffffff), value, "Count32(0xffffffff).ToUint64() value") |
| 30 | assert.True(overflow, "NewCount32(0xffffffff).ToUint64() overflows") |
| 31 | } |
| 32 | |
| 33 | func TestCount64(t *testing.T) { |
| 34 | assert := assert.New(t) |
nothing calls this directly
no test coverage detected