()
| 312 | |
| 313 | #[test] |
| 314 | fn selected_clock_source_display() { |
| 315 | let clock = SelectedClockSource::default(); |
| 316 | assert_eq!(clock.to_string(), "INIT (stratum 0)"); |
| 317 | |
| 318 | clock.set_to_phc(); |
| 319 | assert_eq!(clock.to_string(), "PHC (stratum 0)"); |
| 320 | |
| 321 | clock.set_to_vmclock(); |
| 322 | assert_eq!(clock.to_string(), "VMClock (stratum 0)"); |
| 323 | |
| 324 | clock.set_to_server("169.254.169.123".parse().unwrap(), Stratum::ONE); |
| 325 | assert_eq!( |
| 326 | clock.to_string(), |
| 327 | "Server([169, 254, 169, 123]) (stratum 1)" |
| 328 | ); |
| 329 | |
| 330 | clock.set_to_server("169.254.169.123".parse().unwrap(), Stratum::TWO); |
| 331 | assert_eq!( |
| 332 | clock.to_string(), |
| 333 | "Server([169, 254, 169, 123]) (stratum 2)" |
| 334 | ); |
| 335 | |
| 336 | clock.set_to_none(); |
| 337 | assert_eq!(clock.to_string(), "None (stratum 16)"); |
| 338 | } |
| 339 | } |
nothing calls this directly
no test coverage detected