aboutsummaryrefslogtreecommitdiff
path: root/src/hash/crc32/crc32_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash/crc32/crc32_test.go')
-rw-r--r--src/hash/crc32/crc32_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hash/crc32/crc32_test.go b/src/hash/crc32/crc32_test.go
index 4bdafaf8f5..cbb869dfd6 100644
--- a/src/hash/crc32/crc32_test.go
+++ b/src/hash/crc32/crc32_test.go
@@ -13,6 +13,16 @@ import (
"testing"
)
+// First test, so that it can be the one to initialize castagnoliTable.
+func TestCastagnoliRace(t *testing.T) {
+ // The MakeTable(Castagnoli) lazily initializes castagnoliTable,
+ // which races with the switch on tab during Write to check
+ // whether tab == castagnoliTable.
+ ieee := NewIEEE()
+ go MakeTable(Castagnoli)
+ ieee.Write([]byte("hello"))
+}
+
type test struct {
ieee, castagnoli uint32
in string