device: use bytes.Equal for equality check, simplify assertEqual

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2019-06-03 16:44:06 -04:00 committed by Jason A. Donenfeld
parent 18b6627f33
commit 8d76ac8cc4

View file

@ -61,8 +61,8 @@ func assertNil(t *testing.T, err error) {
} }
} }
func assertEqual(t *testing.T, a []byte, b []byte) { func assertEqual(t *testing.T, a, b []byte) {
if bytes.Compare(a, b) != 0 { if !bytes.Equal(a, b) {
t.Fatal(a, "!=", b) t.Fatal(a, "!=", b)
} }
} }