Restrict global and function references to memory size

This commit is contained in:
Ian Gulliver
2021-11-20 18:12:17 -10:00
parent bdb6b17187
commit bd84a5b969
6 changed files with 35 additions and 11 deletions

View File

@@ -29,8 +29,8 @@ func TestRandBiasedUint64(t *testing.T) {
}
}
if max - min > max / 10 {
t.Fatalf("Variance greater than allowed: %d > %d (max=%d min=%d)", max - min, max / 10, max, min)
if max-min > max/10 {
t.Fatalf("Variance greater than allowed: %d > %d (max=%d min=%d)", max-min, max/10, max, min)
}
}
@@ -48,9 +48,9 @@ func TestRandBiasedInt64(t *testing.T) {
case val == 0:
buckets[63]++
case val < 0:
buckets[63 + bits.Len64(uint64(val * -1))]++
buckets[63+bits.Len64(uint64(val*-1))]++
case val > 0:
buckets[63 - bits.Len64(uint64(val))]++
buckets[63-bits.Len64(uint64(val))]++
}
}
@@ -67,7 +67,7 @@ func TestRandBiasedInt64(t *testing.T) {
}
}
if max - min > max / 10 {
t.Fatalf("Variance greater than allowed: %d > %d (max=%d min=%d)", max - min, max / 10, max, min)
if max-min > max/10 {
t.Fatalf("Variance greater than allowed: %d > %d (max=%d min=%d)", max-min, max/10, max, min)
}
}