File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments