test: Resolve some FIXMEs

This commit is contained in:
Brian Anderson 2012-02-05 16:50:54 -08:00
parent 67b1034989
commit 34aa956e68
4 changed files with 27 additions and 25 deletions

View file

@ -81,9 +81,19 @@ fn test_chan() {
assert (ch1 == ch2);
}
fn test_ptr() {
// FIXME: Don't know what binops apply to pointers. Don't know how
// to make or use pointers
fn test_ptr() unsafe {
let p1: *u8 = unsafe::reinterpret_cast(0);
let p2: *u8 = unsafe::reinterpret_cast(0);
let p3: *u8 = unsafe::reinterpret_cast(1);
assert p1 == p2;
assert p1 != p3;
assert p1 < p3;
assert p1 <= p3;
assert p3 > p1;
assert p3 >= p3;
assert p1 <= p2;
assert p1 >= p2;
}
fn test_task() {
@ -121,13 +131,12 @@ fn test_fn() {
#[nolink]
native mod test {
fn unsupervise();
fn get_task_id();
}
// FIXME (#1058): comparison of native fns
fn test_native_fn() {
/*
assert (native_mod::last_os_error != native_mod::unsupervise);
*/
assert test::unsupervise != test::get_task_id;
assert test::unsupervise == test::unsupervise;
}
fn main() {

View file

@ -7,9 +7,7 @@ fn target() {
#[cfg(target_arch = "x86_64")]
fn target() {
// FIXME (974) Can't lex this as a single integer
assert (-1000 >> 3 == 23058430 * 1000000000 * 100
+ 92 * 100000000 + 13693827);
assert (-1000 >> 3 == 2305843009213693827);
}
fn general() {

View file

@ -62,8 +62,7 @@ fn test_box_rec() {
fn main() {
test_box();
test_rec();
// FIXME: enum constructors don't optimize their arguments into moves
// test_tag();
test_tag();
test_tup();
test_unique();
test_box_rec();

View file

@ -34,19 +34,15 @@ fn test_vec() {
}
fn test_str() {
// FIXME: re-enable this once strings are unique and sendable
/*
let po = comm::mk_port();
let ch = po.mk_chan();
let s0: str = "test";
send(ch, s0);
let s1: str;
s1 = po.recv();
assert (s1.(0) as u8 == 't' as u8);
assert (s1.(1) as u8 == 'e' as u8);
assert (s1.(2) as u8 == 's' as u8);
assert (s1.(3) as u8 == 't' as u8);
*/
let po = port();
let ch = chan(po);
let s0 = "test";
send(ch, s0);
let s1 = recv(po);
assert (s1[0] == 't' as u8);
assert (s1[1] == 'e' as u8);
assert (s1[2] == 's' as u8);
assert (s1[3] == 't' as u8);
}
fn test_tag() {