Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions zircon-object/src/task/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,14 @@ mod tests {
#[test]
fn create() {
let root_job = Job::root();
let job: Arc<dyn KernelObject> =
Job::create_child(&root_job).expect("failed to create job");
let job = Job::create_child(&root_job).expect("failed to create job");

assert!(Arc::ptr_eq(&root_job.get_child(job.id()).unwrap(), &job));
let child = root_job
.get_child(job.id())
.unwrap()
.downcast_arc()
.unwrap();
assert!(Arc::ptr_eq(&child, &job));
assert_eq!(job.related_koid(), root_job.id());
assert_eq!(root_job.related_koid(), 0);

Expand Down
4 changes: 2 additions & 2 deletions zircon-object/src/task/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,9 @@ mod tests {
let thread = Thread::create(&proc, "thread").expect("failed to create thread");
assert_eq!(thread.flags(), ThreadFlag::empty());

let thread: Arc<dyn KernelObject> = thread;
assert_eq!(thread.related_koid(), proc.id());
assert!(Arc::ptr_eq(&proc.get_child(thread.id()).unwrap(), &thread));
let child = proc.get_child(thread.id()).unwrap().downcast_arc().unwrap();
assert!(Arc::ptr_eq(&child, &thread));
}

#[async_std::test]
Expand Down