File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -304,10 +304,14 @@ mod tests {
304
304
#[ test]
305
305
fn create ( ) {
306
306
let root_job = Job :: root ( ) ;
307
- let job: Arc < dyn KernelObject > =
308
- Job :: create_child ( & root_job) . expect ( "failed to create job" ) ;
307
+ let job = Job :: create_child ( & root_job) . expect ( "failed to create job" ) ;
309
308
310
- assert ! ( Arc :: ptr_eq( & root_job. get_child( job. id( ) ) . unwrap( ) , & job) ) ;
309
+ let child = root_job
310
+ . get_child ( job. id ( ) )
311
+ . unwrap ( )
312
+ . downcast_arc ( )
313
+ . unwrap ( ) ;
314
+ assert ! ( Arc :: ptr_eq( & child, & job) ) ;
311
315
assert_eq ! ( job. related_koid( ) , root_job. id( ) ) ;
312
316
assert_eq ! ( root_job. related_koid( ) , 0 ) ;
313
317
Original file line number Diff line number Diff line change @@ -740,9 +740,9 @@ mod tests {
740
740
let thread = Thread :: create ( & proc, "thread" ) . expect ( "failed to create thread" ) ;
741
741
assert_eq ! ( thread. flags( ) , ThreadFlag :: empty( ) ) ;
742
742
743
- let thread: Arc < dyn KernelObject > = thread;
744
743
assert_eq ! ( thread. related_koid( ) , proc. id( ) ) ;
745
- assert ! ( Arc :: ptr_eq( & proc. get_child( thread. id( ) ) . unwrap( ) , & thread) ) ;
744
+ let child = proc. get_child ( thread. id ( ) ) . unwrap ( ) . downcast_arc ( ) . unwrap ( ) ;
745
+ assert ! ( Arc :: ptr_eq( & child, & thread) ) ;
746
746
}
747
747
748
748
#[ async_std:: test]
You can’t perform that action at this time.
0 commit comments