diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-07 19:16:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 19:16:55 +0800 |
commit | fc0c6c175c830283252deb436138e2abf9a6d126 (patch) | |
tree | 3552a14bc030eee7612267cd6842086330fed9cf /common/bitutil | |
parent | 7c74e166b0ee14cf040374f522bc399841a11e69 (diff) | |
parent | 392151e251fef59bf72df5a33899724edb7238b9 (diff) | |
download | dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar.gz dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar.bz2 dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar.lz dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar.xz dexon-fc0c6c175c830283252deb436138e2abf9a6d126.tar.zst dexon-fc0c6c175c830283252deb436138e2abf9a6d126.zip |
Merge pull request #14913 from egonelbre/megacheck_common
common: fix megacheck warnings
Diffstat (limited to 'common/bitutil')
-rw-r--r-- | common/bitutil/compress_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/bitutil/compress_test.go b/common/bitutil/compress_test.go index 805ab0369..9bd1de103 100644 --- a/common/bitutil/compress_test.go +++ b/common/bitutil/compress_test.go @@ -121,20 +121,20 @@ func TestCompression(t *testing.T) { in := hexutil.MustDecode("0x4912385c0e7b64000000") out := hexutil.MustDecode("0x80fe4912385c0e7b64") - if data := CompressBytes(in); bytes.Compare(data, out) != 0 { + if data := CompressBytes(in); !bytes.Equal(data, out) { t.Errorf("encoding mismatch for sparse data: have %x, want %x", data, out) } - if data, err := DecompressBytes(out, len(in)); err != nil || bytes.Compare(data, in) != 0 { + if data, err := DecompressBytes(out, len(in)); err != nil || !bytes.Equal(data, in) { t.Errorf("decoding mismatch for sparse data: have %x, want %x, error %v", data, in, err) } // Check the the compression returns the input if the bitset encoding is longer in = hexutil.MustDecode("0xdf7070533534333636313639343638373532313536346c1bc33339343837313070706336343035336336346c65fefb3930393233383838ac2f65fefb") out = hexutil.MustDecode("0xdf7070533534333636313639343638373532313536346c1bc33339343837313070706336343035336336346c65fefb3930393233383838ac2f65fefb") - if data := CompressBytes(in); bytes.Compare(data, out) != 0 { + if data := CompressBytes(in); !bytes.Equal(data, out) { t.Errorf("encoding mismatch for dense data: have %x, want %x", data, out) } - if data, err := DecompressBytes(out, len(in)); err != nil || bytes.Compare(data, in) != 0 { + if data, err := DecompressBytes(out, len(in)); err != nil || !bytes.Equal(data, in) { t.Errorf("decoding mismatch for dense data: have %x, want %x, error %v", data, in, err) } // Check that decompressing a longer input than the target fails |