summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-09-08 01:19:42 -0300
committerOri Bernstein <ori@mmarkovcorp.com>2017-09-08 11:00:44 -0700
commit63b175e2da14c72d77f329f05385402104ef0fc7 (patch)
tree7a532c1e5cbc8e9c08eeff1f61077cda2b734907 /lib/std/test
parente5b424be893e7f771456a548ab66e1bcb7ed50d3 (diff)
downloadmc-63b175e2da14c72d77f329f05385402104ef0fc7.tar.gz
Replace murmurhash with siphash
Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/bitset.myr6
-rw-r--r--lib/std/test/hashfuncs.myr4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/test/bitset.myr b/lib/std/test/bitset.myr
index 9112537..6936cba 100644
--- a/lib/std/test/bitset.myr
+++ b/lib/std/test/bitset.myr
@@ -49,11 +49,11 @@ const main = {
}],
[.name="hash", .fn={ctx
var bs = mkset([][:])
- testr.check(ctx, std.bshash(bs) == 2580988821, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x726fdb47dd0e0e31, "wrong hash, got {}", std.bshash(bs))
std.bsput(bs, 123456)
- testr.check(ctx, std.bshash(bs) == 2020624217, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x778abc1d7706143b, "wrong hash, got {}", std.bshash(bs))
std.bsdel(bs, 123456)
- testr.check(ctx, std.bshash(bs) == 2580988821, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x726fdb47dd0e0e31, "wrong hash, got {}", std.bshash(bs))
std.bsfree(bs)
}]
][:])
diff --git a/lib/std/test/hashfuncs.myr b/lib/std/test/hashfuncs.myr
index ee10ad7..94313b0 100644
--- a/lib/std/test/hashfuncs.myr
+++ b/lib/std/test/hashfuncs.myr
@@ -4,7 +4,7 @@ use testr
const main = {
testr.run([
[.name="string hash and equality", .fn={ctx
- testr.check(ctx, std.strhash("abc") == 1241861192, "wrong hash\n")
+ testr.check(ctx, std.strhash("abc") == 0x5dbcfa53aa2007a5, "wrong hash\n")
testr.check(ctx, std.streq("abc\0def", "abc\0def"), "equal strings not equal\n")
testr.check(ctx, !std.streq("abc\0def", "abcdef"), "unequal strings are equal\n")
}],
@@ -20,7 +20,7 @@ const main = {
testr.check(ctx, !std.ptreq(&x, &y), "unequal pointers are equal")
}],
[.name="int hash and equality", .fn={ctx
- testr.check(ctx, std.inthash(123) == 3497506805, "wrong int hash")
+ testr.check(ctx, std.inthash(123) == 0x5671db246859d5b6, "wrong int hash")
testr.check(ctx, std.inteq(123, 123), "equal integers not equal")
testr.check(ctx, !std.inteq(123, 456), "unequal integers are equal")
}],