use super::*;
bfs_test!(
complete_3_nodes,
1,
3,
1,
&complete_edges(3),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..3).map(|b| (0, b, 0)).collect()
);
bfs_test!(
complete_4_nodes,
1,
4,
1,
&complete_edges(4),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..4).map(|b| (0, b, 0)).collect()
);
bfs_test!(
cycle_3_nodes,
1,
3,
1,
&cycle_edges(3),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..3).map(|b| (0, b, 0)).collect()
);
bfs_test!(
cycle_4_nodes,
1,
4,
1,
&cycle_edges(4),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..4).map(|b| (0, b, 0)).collect()
);
bfs_test!(
cycle_10_nodes,
1,
10,
1,
&cycle_edges(10),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..10).map(|b| (0, b, 0)).collect()
);
bfs_test!(
cycle_50_nodes,
1,
50,
1,
&cycle_edges(50),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..50).map(|b| (0, b, 0)).collect()
);
bfs_test!(
cycle_100_nodes,
1,
100,
1,
&cycle_edges(100),
&[],
&[],
&[],
&[(0, 0, 0)],
(0..100).map(|b| (0, b, 0)).collect()
);
bfs_test!(
kill_stops_propagation,
1,
3,
1,
&[(0, 0, 1), (0, 1, 2)],
&[],
&[],
&[(0, 1, 0)],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0)]
);
bfs_test!(
gen_introduces_fact,
1,
2,
2,
&[(0, 0, 1)],
&[],
&[(0, 0, 1)],
&[],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0), (0, 1, 1)]
);
bfs_test!(
interprocedural_call_propagates_fact,
2,
2,
1,
&[(0, 0, 1), (1, 0, 1)],
&[(0, 1, 1, 0)],
&[],
&[],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 0)]
);
bfs_test!(
interprocedural_call_two_procs,
2,
2,
1,
&[(0, 0, 1), (1, 0, 1)],
&[(0, 1, 1, 0)],
&[],
&[],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 0)]
);
bfs_test!(
multiple_facts_per_block,
1,
2,
3,
&[(0, 0, 1)],
&[],
&[],
&[],
&[(0, 0, 0), (0, 0, 1)],
vec![(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1)]
);
bfs_test!(
multiple_procs_no_inter,
2,
2,
1,
&[(0, 0, 1), (1, 0, 1)],
&[],
&[],
&[],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0)]
);
bfs_test!(
diamond_cfg,
1,
4,
1,
&[(0, 0, 1), (0, 0, 2), (0, 1, 3), (0, 2, 3)],
&[],
&[],
&[],
&[(0, 0, 0)],
(0..4).map(|b| (0, b, 0)).collect()
);
bfs_test!(
diamond_with_kill,
1,
4,
1,
&[(0, 0, 1), (0, 0, 2), (0, 1, 3), (0, 2, 3)],
&[],
&[],
&[(0, 1, 0)],
&[(0, 0, 0)],
(0..4).map(|b| (0, b, 0)).collect()
);
bfs_test!(
branch_merge_reaches_all,
1,
3,
1,
&[(0, 0, 1), (0, 0, 2)],
&[],
&[],
&[],
&[(0, 0, 0)],
vec![(0, 0, 0), (0, 1, 0), (0, 2, 0)]
);
bfs_test!(
two_seeds_same_component,
1,
3,
1,
&[(0, 0, 1), (0, 1, 2)],
&[],
&[],
&[],
&[(0, 0, 0), (0, 2, 0)],
vec![(0, 0, 0), (0, 1, 0), (0, 2, 0)]
);
bfs_test!(
two_seeds_different_components,
2,
2,
1,
&[(0, 0, 1)],
&[],
&[],
&[],
&[(0, 0, 0), (1, 1, 0)],
vec![(0, 0, 0), (0, 1, 0), (1, 1, 0)]
);
bfs_test!(
three_seeds_mixed,
2,
2,
1,
&[(0, 0, 1), (1, 0, 1)],
&[],
&[],
&[],
&[(0, 0, 0), (0, 1, 0), (1, 0, 0)],
vec![(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 0)]
);
bfs_test!(
all_nodes_seeded,
1,
3,
2,
&[(0, 0, 1)],
&[],
&[],
&[],
&[
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(0, 2, 0),
(0, 2, 1)
],
all_triples(1, 3, 2)
);