]> gitweb.michael.orlitzky.com - hath.git/commitdiff
src/IPv4Address.hs: fix the inverse toEnum/fromEnum property on x86.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Mar 2019 02:26:31 +0000 (21:26 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Mar 2019 02:26:31 +0000 (21:26 -0500)
The second half of the fix in the previous commit turned out to be in
the test itself. The "smallness test" that I was using was to compare
against the number (2^32 - 1), which works great if said number is
interpreted as a 64-bit integer. However on x86 systems, it's a 32-bit
integer, namely negative one! Oops.

This commit splits that test into two; one that tests randomly-generated
Int32s, and one that tests randomly-generated Int64s. Hopefully this
ensures that no similar problems with the machine Int type creep in.


No differences found