Skip to content

Commit

Permalink
Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Matts966 committed Jul 14, 2020
1 parent a0eee84 commit 2ed252e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions alphasql/dag_lib_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ bool has_cycle = false;

TEST(cycle_detector, cycle) {
Graph g1(2);
add_edge(0, 1, g);
add_edge(1, 0, g);
add_edge(0, 1, g1);
add_edge(1, 0, g1);
cycle_detector vis(has_cycle);
depth_first_search(g, visitor(vis));
depth_first_search(g1, visitor(vis));
ASSERT_TRUE(has_cycle);

has_cycle = false;
Graph g2(3);
add_edge(0, 1, g2);
add_edge(1, 2, g2);
add_edge(2, 0, g2);
cycle_detector vis(has_cycle);
depth_first_search(g2, visitor(vis));
cycle_detector vis2(has_cycle);
depth_first_search(g2, visitor(vis2));
ASSERT_TRUE(has_cycle);

has_cycle = false;
Expand All @@ -50,27 +50,28 @@ TEST(cycle_detector, cycle) {
add_edge(2, 3, g3);
add_edge(3, 4, g3);
add_edge(4, 0, g3);
cycle_detector vis(has_cycle);
depth_first_search(g3, visitor(vis));
cycle_detector vis3(has_cycle);
depth_first_search(g3, visitor(vis3));
ASSERT_TRUE(has_cycle);
}

TEST(cycle_detector, acycle) {
has_cycle = false;
Graph g1(2);
add_edge(0, 1, g);
add_edge(0, 1, g1);
cycle_detector vis(has_cycle);
depth_first_search(g, visitor(vis));
depth_first_search(g1, visitor(vis));
ASSERT_FALSE(has_cycle);

has_cycle = false;
Graph g2(3);
add_edge(0, 1, g2);
add_edge(1, 2, g2);
add_edge(0, 2, g2);
cycle_detector vis(has_cycle);
depth_first_search(g2, visitor(vis));
cycle_detector vis2(has_cycle);
depth_first_search(g2, visitor(vis2));
ASSERT_FALSE(has_cycle);
}

}
}

0 comments on commit 2ed252e

Please sign in to comment.