(t *testing.T)
| 151 | } |
| 152 | |
| 153 | func TestFNVHash32B(t *testing.T) { |
| 154 | tests := []struct { |
| 155 | out []byte |
| 156 | in string |
| 157 | }{ |
| 158 | {[]byte{0x81, 0x1c, 0x9d, 0xc5}, ""}, |
| 159 | {[]byte{0x05, 0x0c, 0x5d, 0x7e}, "a"}, |
| 160 | {[]byte{0x70, 0x77, 0x2d, 0x38}, "ab"}, |
| 161 | {[]byte{0x43, 0x9c, 0x2f, 0x4b}, "abc"}, |
| 162 | } |
| 163 | |
| 164 | for _, test := range tests { |
| 165 | hash := FNVHash32B([]byte(test.in)) |
| 166 | if bytes.Compare(hash, test.out) != 0 { |
| 167 | t.Errorf("FNVHash32B(%q) = %s, want %s", test.in, hash, |
| 168 | test.out) |
| 169 | continue |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | func TestFNVHash32uint(t *testing.T) { |
| 175 | tests := []struct { |
nothing calls this directly
no test coverage detected