pub fn random_roundtrip<M: Transform + Default>(trips: usize, size: usize) {
        for _ in 0..trips {
            let mut input = vec![0u8; size];
            OsRng.fill_bytes(&mut input);
            let mut model: M = Default::default();
            let tmp = model.transform(&input).unwrap();
            let result = model.reverse(&tmp).unwrap();
            if result != input {
                println!("Input:       {:?}", input);
                println!("Transformed: {:?}", tmp);
                println!("Reversed:    {:?}", result);
            }
            assert_eq!(result, input)
        }
    }
/// Helper function for testing random transformation roundtrips
Helper function for testing random transformation roundtrips
Helper function for testing random transformation roundtrips
pub fn random_roundtrip<M: Transform + Default>(trips: usize, size: usize) {
        for _ in 0..trips {
            let mut input = vec![0u8; size];
            OsRng.fill_bytes(&mut input);
            let mut model: M = Default::default();
            let tmp = model.transform(&input).unwrap();
            let result = model.reverse(&tmp).unwrap();
            if result != input {
                println!("Input:       {:?}", input);
                println!("Transformed: {:?}", tmp);
                println!("Reversed:    {:?}", result);
            }
            assert_eq!(result, input)
        }
    }
pub fn random_roundtrip < M : Transform + Default > ( trips : usize , size : usize ) { for _ in 0 .. trips { let mut input = vec ! [ 0u8 size ] ; OsRng . fill_bytes ( & mut input ) ; let mut model : M = Default :: default ( ) ; let tmp = model . transform ( & input ) . unwrap ( ) ; let result = model . reverse ( & tmp ) . unwrap ( ) ; if result != input { println ! ( " " input ) ; println ! ( " " tmp ) ; println ! ( " " result ) ; } assert_eq ! ( result input ) } }
Helper function for testing random transformation roundtrips
Helper function for testing random transformation roundtrips
trips
usize
size
usize
trips
usize
size
usize