From 9e9ec347602a40f82e6f5f4935908c0c8eb448a7 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 24 Apr 2014 09:59:56 +0000 Subject: [LCG] Re-order expectations to provide more useful output when debugging an issue. This way you see that the number of nodes was wrong before a crash due to accessing too many nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207094 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Analysis/LazyCallGraphTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unittests/Analysis/LazyCallGraphTest.cpp') diff --git a/unittests/Analysis/LazyCallGraphTest.cpp b/unittests/Analysis/LazyCallGraphTest.cpp index 781d98ee50..058027f2e1 100644 --- a/unittests/Analysis/LazyCallGraphTest.cpp +++ b/unittests/Analysis/LazyCallGraphTest.cpp @@ -209,40 +209,40 @@ TEST(LazyCallGraphTest, BasicGraphFormation) { for (LazyCallGraph::Node *N : D) Nodes.push_back(N->getFunction().getName()); std::sort(Nodes.begin(), Nodes.end()); + EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("d1", Nodes[0]); EXPECT_EQ("d2", Nodes[1]); EXPECT_EQ("d3", Nodes[2]); - EXPECT_EQ(3u, Nodes.size()); Nodes.clear(); LazyCallGraph::SCC &C = *SCCI++; for (LazyCallGraph::Node *N : C) Nodes.push_back(N->getFunction().getName()); std::sort(Nodes.begin(), Nodes.end()); + EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("c1", Nodes[0]); EXPECT_EQ("c2", Nodes[1]); EXPECT_EQ("c3", Nodes[2]); - EXPECT_EQ(3u, Nodes.size()); Nodes.clear(); LazyCallGraph::SCC &B = *SCCI++; for (LazyCallGraph::Node *N : B) Nodes.push_back(N->getFunction().getName()); std::sort(Nodes.begin(), Nodes.end()); + EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("b1", Nodes[0]); EXPECT_EQ("b2", Nodes[1]); EXPECT_EQ("b3", Nodes[2]); - EXPECT_EQ(3u, Nodes.size()); Nodes.clear(); LazyCallGraph::SCC &A = *SCCI++; for (LazyCallGraph::Node *N : A) Nodes.push_back(N->getFunction().getName()); std::sort(Nodes.begin(), Nodes.end()); + EXPECT_EQ(3u, Nodes.size()); EXPECT_EQ("a1", Nodes[0]); EXPECT_EQ("a2", Nodes[1]); EXPECT_EQ("a3", Nodes[2]); - EXPECT_EQ(3u, Nodes.size()); Nodes.clear(); EXPECT_EQ(CG.postorder_scc_end(), SCCI); -- cgit v1.2.3