Skip to content

Commit

Permalink
all tests succeed now
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Oct 15, 2023
1 parent 13eaa4a commit b915d3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ else if (isRationalType(other)) {
}
}

@Override
public int hashCode(){
int h = value ^ 0x85ebca6b;
// based on the final Avalanching phase of MurmurHash2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ public void testFingerprintStabilityIntegersDoNotChangeTheTest(IValueFactory vf,
// this should stay or we have to make sure that the fingerprint works like that again
// if it changes
if (!integer.equals(vf.integer(0)) && integer.less(vf.integer(Integer.MAX_VALUE)).getValue() && integer.greater(vf.integer(Integer.MIN_VALUE)).getValue()) {
assertEquals(integer.intValue(), integer.hashCode());
// copied the implementation of IntegerValue.hashCode here
// because this is now officially a contract.
int hash = integer.intValue() ^ 0x85ebca6b;
hash ^= hash >>> 13;
hash *= 0x5bd1e995;
hash ^= hash >>> 15;

assertEquals(hash, integer.getMatchFingerprint());
}
}

Expand Down

0 comments on commit b915d3c

Please sign in to comment.