diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-31 18:18:45 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-31 18:18:45 -0400 |
| commit | 513557b465a6393aebf8d309320c7eaab9ceae2c (patch) | |
| tree | 2bb15b717a3d0d03a68be35690c443079c221e0a /src/libcore | |
| parent | 77efd389dcec4b4bb43235c8d91ffaf87b8947d0 (diff) | |
Add hash uint tests
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/hash.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libcore/hash.rs b/src/libcore/hash.rs index 83fad4867ce..b6efa8fe728 100644 --- a/src/libcore/hash.rs +++ b/src/libcore/hash.rs @@ -382,3 +382,22 @@ fn test_siphash() { t += 1; } } + +#[test] #[cfg(target_arch = "arm")] +fn test_hash_uint() { + let val = 0xdeadbeef_deadbeef_u64; + assert hash_u64(val as u64) == hash_uint(val as uint); + assert hash_u32(val as u32) != hash_uint(val as uint); +} +#[test] #[cfg(target_arch = "x86_64")] +fn test_hash_uint() { + let val = 0xdeadbeef_deadbeef_u64; + assert hash_u64(val as u64) == hash_uint(val as uint); + assert hash_u32(val as u32) != hash_uint(val as uint); +} +#[test] #[cfg(target_arch = "x86")] +fn test_hash_uint() { + let val = 0xdeadbeef_deadbeef_u64; + assert hash_u64(val as u64) != hash_uint(val as uint); + assert hash_u32(val as u32) == hash_uint(val as uint); +} |
