(ips: Vec<u32>, flags: u8)
| 1924 | #[test] |
| 1925 | fn prop_state_encode_decode() { |
| 1926 | fn p(ips: Vec<u32>, flags: u8) -> bool { |
| 1927 | let mut data = vec![flags]; |
| 1928 | let mut prev = 0; |
| 1929 | for &ip in ips.iter() { |
| 1930 | push_inst_ptr(&mut data, &mut prev, ip); |
| 1931 | } |
| 1932 | let state = State { data: Arc::from(&data[..]) }; |
| 1933 | |
| 1934 | let expected: Vec<usize> = |
| 1935 | ips.into_iter().map(|ip| ip as usize).collect(); |
| 1936 | let got: Vec<usize> = state.inst_ptrs().collect(); |
| 1937 | expected == got && state.flags() == StateFlags(flags) |
| 1938 | } |
| 1939 | QuickCheck::new() |
| 1940 | .gen(StdGen::new(self::rand::thread_rng(), 10_000)) |
| 1941 | .quickcheck(p as fn(Vec<u32>, u8) -> bool); |
nothing calls this directly
no test coverage detected