gommon icon indicating copy to clipboard operation
gommon copied to clipboard

do not rely on undefined behaviour in bytes_test.go

Open ondrejbudai opened this issue 5 years ago • 1 comments

8 exbi equals 2^64, therefore it cannot be stored in int64. The tests use the fact that on x86_64 the following expressions holds true: int64(0) - 1 == math.MaxInt64.

However, this is not true for other platforms, specifically aarch64, s390x and ppc64le.

This commit fixes it by testing the library with 7 exbi.

Fixes #37

ondrejbudai avatar Aug 26 '20 13:08 ondrejbudai

Codecov Report

Merging #38 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #38   +/-   ##
=======================================
  Coverage   59.26%   59.26%           
=======================================
  Files           6        6           
  Lines         518      518           
=======================================
  Hits          307      307           
  Misses        208      208           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4919956...5c8aceb. Read the comment docs.

codecov-commenter avatar Aug 26 '20 13:08 codecov-commenter