Add tests for unsafe::reinterpret_cast

This commit is contained in:
Brian Anderson 2011-11-17 13:44:02 -08:00
parent 9ca2005959
commit 44aebb978c
2 changed files with 14 additions and 0 deletions

View file

@ -34,6 +34,7 @@ mod task;
mod test;
mod treemap;
mod uint;
mod unsafe;
mod vec;
// Local Variables:

View file

@ -0,0 +1,13 @@
import std::unsafe;
#[test]
fn reinterpret_cast() unsafe {
assert unsafe::reinterpret_cast(1) == 1u;
}
#[test]
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn reinterpret_cast_wrong_size() unsafe {
let _i: uint = unsafe::reinterpret_cast(0u8);
}