File tree Expand file tree Collapse file tree 4 files changed +27
-25
lines changed Expand file tree Collapse file tree 4 files changed +27
-25
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,19 @@ fn test_chan() {
8181 assert ( ch1 == ch2) ;
8282}
8383
84- fn test_ptr ( ) {
85- // FIXME: Don't know what binops apply to pointers. Don't know how
86- // to make or use pointers
84+ fn test_ptr ( ) unsafe {
85+ let p1: * u8 = unsafe :: reinterpret_cast ( 0 ) ;
86+ let p2: * u8 = unsafe :: reinterpret_cast ( 0 ) ;
87+ let p3: * u8 = unsafe :: reinterpret_cast ( 1 ) ;
88+
89+ assert p1 == p2;
90+ assert p1 != p3;
91+ assert p1 < p3;
92+ assert p1 <= p3;
93+ assert p3 > p1;
94+ assert p3 >= p3;
95+ assert p1 <= p2;
96+ assert p1 >= p2;
8797}
8898
8999fn test_task ( ) {
@@ -121,13 +131,12 @@ fn test_fn() {
121131#[ nolink]
122132native mod test {
123133 fn unsupervise ( ) ;
134+ fn get_task_id ( ) ;
124135}
125136
126- // FIXME (#1058): comparison of native fns
127137fn test_native_fn ( ) {
128- /*
129- assert (native_mod::last_os_error != native_mod::unsupervise);
130- */
138+ assert test:: unsupervise != test:: get_task_id;
139+ assert test:: unsupervise == test:: unsupervise;
131140}
132141
133142fn main ( ) {
Original file line number Diff line number Diff line change @@ -7,9 +7,7 @@ fn target() {
77
88#[ cfg( target_arch = "x86_64" ) ]
99fn target ( ) {
10- // FIXME (974) Can't lex this as a single integer
11- assert ( -1000 >> 3 == 23058430 * 1000000000 * 100
12- + 92 * 100000000 + 13693827 ) ;
10+ assert ( -1000 >> 3 == 2305843009213693827 ) ;
1311}
1412
1513fn general ( ) {
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ fn test_box_rec() {
6262fn main ( ) {
6363 test_box ( ) ;
6464 test_rec ( ) ;
65- // FIXME: enum constructors don't optimize their arguments into moves
66- // test_tag();
65+ test_tag ( ) ;
6766 test_tup ( ) ;
6867 test_unique ( ) ;
6968 test_box_rec ( ) ;
Original file line number Diff line number Diff line change @@ -34,19 +34,15 @@ fn test_vec() {
3434}
3535
3636fn test_str ( ) {
37- // FIXME: re-enable this once strings are unique and sendable
38- /*
39- let po = comm::mk_port();
40- let ch = po.mk_chan();
41- let s0: str = "test";
42- send(ch, s0);
43- let s1: str;
44- s1 = po.recv();
45- assert (s1.(0) as u8 == 't' as u8);
46- assert (s1.(1) as u8 == 'e' as u8);
47- assert (s1.(2) as u8 == 's' as u8);
48- assert (s1.(3) as u8 == 't' as u8);
49- */
37+ let po = port ( ) ;
38+ let ch = chan ( po) ;
39+ let s0 = "test" ;
40+ send ( ch, s0) ;
41+ let s1 = recv ( po) ;
42+ assert ( s1[ 0 ] == 't' as u8 ) ;
43+ assert ( s1[ 1 ] == 'e' as u8 ) ;
44+ assert ( s1[ 2 ] == 's' as u8 ) ;
45+ assert ( s1[ 3 ] == 't' as u8 ) ;
5046}
5147
5248fn test_tag ( ) {
You can’t perform that action at this time.
0 commit comments