[#1507] timer/test: Use const for constants

Make it easy to see what the test is about.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-11-20 10:55:24 +03:00 committed by Evgenii Stratonikov
parent 2e974f734c
commit 49a4e727fd

View file

@ -18,7 +18,7 @@ func tickN(t *timer.BlockTimer, n uint32) {
// "resetting" consists of ticking the current height as well and invoking `Reset`.
func TestIRBlockTimer_Reset(t *testing.T) {
var baseCounter [2]int
blockDur := uint32(3)
const blockDur = uint32(3)
bt1 := timer.NewBlockTimer(
func() (uint32, error) { return blockDur, nil },
@ -82,7 +82,7 @@ func TestBlockTimer_ResetChangeDuration(t *testing.T) {
}
func TestBlockTimer(t *testing.T) {
blockDur := uint32(10)
const blockDur = uint32(10)
baseCallCounter := uint32(0)
bt := timer.NewBlockTimer(timer.StaticBlockMeter(blockDur), func() {