MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / test_stride_estimator

Function test_stride_estimator

hail-fuzz/src/i2s/analysis.rs:347–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

345
346#[test]
347fn 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]
367fn value_size() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected