[#1507] timer/test: Use const for constants
All checks were successful
DCO action / DCO (pull_request) Successful in 4m0s
Vulncheck / Vulncheck (pull_request) Successful in 3m50s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m38s
Tests and linters / Staticcheck (pull_request) Successful in 4m44s
Tests and linters / Run gofumpt (pull_request) Successful in 4m54s
Tests and linters / gopls check (pull_request) Successful in 5m26s
Build / Build Components (pull_request) Successful in 5m39s
Tests and linters / Tests with -race (pull_request) Successful in 5m45s
Tests and linters / Lint (pull_request) Successful in 6m30s
Tests and linters / Tests (pull_request) Successful in 7m2s

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
parent a8faee7faf
commit a8f6454e2c
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

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() {