Skip to content

Commit d7bb9f2

Browse files
Fix tests
Signed-off-by: Luca Della Vedova <[email protected]>
1 parent cc59f0a commit d7bb9f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rclrs/src/time_source.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ mod tests {
209209

210210
#[test]
211211
fn time_source_attach_clock() {
212-
let clock = Arc::new(Mutex::new(Clock::new(ClockType::RosTime).unwrap()));
212+
let clock = Arc::new(Clock::new(ClockType::RosTime).unwrap());
213213
let node = create_node(&Context::new([]).unwrap(), "test_node").unwrap();
214-
let time_source = TimeSource::new(node, clock);
215-
let clock = Arc::new(Mutex::new(Clock::new(ClockType::RosTime).unwrap()));
214+
let time_source = TimeSource::new(node.clone(), clock);
215+
let clock = Arc::new(Clock::new(ClockType::RosTime).unwrap());
216216
// Attaching additional clocks should be OK
217217
time_source.attach_clock(clock).unwrap();
218218
// Default clock should be above 0 (use_sim_time is default false)
219-
assert!(node.get_clock().now() > 0);
219+
assert!(node.get_clock().now().nsec > 0);
220220
}
221221
}

0 commit comments

Comments
 (0)