()
| 345 | |
| 346 | #[test] |
| 347 | fn test_stride_estimator() { |
| 348 | let values: &[u8] = &[ |
| 349 | 0x0, 0x1, 0x2, 0x2, 0x2, 0x2, 0x3, 0x3, 0x3, 0x4, 0x4, 0x4, 0x5, 0x5, 0x5, 0x6, 0x6, 0x6, |
| 350 | 0x7, 0x7, 0x7, 0x8, |
| 351 | ]; |
| 352 | let mut estimator = StrideEstimator::from_sequence(values.iter().map(|&x| x as i64)); |
| 353 | assert_eq!(estimator.finalize(), Some(Counter { start: 0, stride: 1, end: 8 })); |
| 354 | |
| 355 | let values: &[u32] = &[ |
| 356 | 0xffffffff, 0xfffffffe, 0xffffffff, 0xfffffffe, 0xfffffffd, 0xfffffffc, 0xfffffffb, |
| 357 | 0xfffffffa, 0xfffffff9, 0xfffffff8, 0xfffffff7, 0xfffffff6, |
| 358 | ]; |
| 359 | let mut estimator = StrideEstimator::from_sequence(values.iter().map(|&x| x as i64)); |
| 360 | assert_eq!( |
| 361 | estimator.finalize(), |
| 362 | Some(Counter { start: 0xffffffff, stride: -1, end: 0xfffffff6 }) |
| 363 | ); |
| 364 | } |
| 365 | |
| 366 | #[test] |
| 367 | fn value_size() { |
nothing calls this directly
no outgoing calls
no test coverage detected