MCPcopy Create free account
hub / github.com/BirolLab/abyss / TEST

Function TEST

Unittest/Graph/ExtendPathTest.cpp:16–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14typedef boost::graph_traits<Graph>::edge_descriptor Edge;
15
16TEST(extendPath, lookAhead)
17{
18 unsigned depth;
19
20 /* case 1: simple path */
21
22 /*
23 * 0--1--2
24 */
25
26 Graph g1;
27 add_edge(0, 1, g1);
28 add_edge(1, 2, g1);
29
30 depth = 1;
31 ASSERT_TRUE(lookAhead(1, FORWARD, depth, g1));
32 ASSERT_TRUE(lookAhead(1, REVERSE, depth, g1));
33 ASSERT_FALSE(lookAhead(2, FORWARD, depth, g1));
34 ASSERT_FALSE(lookAhead(0, REVERSE, depth, g1));
35
36 depth = 2;
37 ASSERT_FALSE(lookAhead(1, FORWARD, depth, g1));
38 ASSERT_FALSE(lookAhead(1, REVERSE, depth, g1));
39 ASSERT_TRUE(lookAhead(0, FORWARD, depth, g1));
40 ASSERT_TRUE(lookAhead(2, REVERSE, depth, g1));
41
42 /* case 2: with branching */
43
44 /*
45 * 2
46 * /
47 * 0--1
48 * \
49 * 3--4
50 */
51
52 Graph g2;
53 add_edge(0, 1, g2);
54 add_edge(1, 2, g2);
55 add_edge(1, 3, g2);
56 add_edge(3, 4, g2);
57
58 depth = 3;
59 ASSERT_TRUE(lookAhead(0, FORWARD, depth, g2));
60
61 depth = 4;
62 ASSERT_FALSE(lookAhead(0, FORWARD, depth, g2));
63}
64
65TEST(extendPath, depth)
66{

Callers

nothing calls this directly

Calls 10

lookAheadFunction · 0.85
depthFunction · 0.85
longestBranchFunction · 0.85
extendPathFunction · 0.85
trueBranchFunction · 0.85
add_edgeFunction · 0.50
edgeFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected