labstack / gommon

Common packages for Go
MIT License
536 stars 100 forks source link

do not rely on undefined behaviour in bytes_test.go #38

Open ondrejbudai opened 4 years ago

ondrejbudai commented 4 years ago

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

codecov-commenter commented 4 years ago

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.