From b9cb1c8a1ebf52695372de12c7b04c8ef1bd8b4e Mon Sep 17 00:00:00 2001 From: Malcolm Parsons Date: Wed, 7 Dec 2016 20:38:20 +0000 Subject: [RecursiveASTVisitor] Improve post-order traversal unit test git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288976 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/AST/PostOrderASTVisitor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unittests/AST') diff --git a/unittests/AST/PostOrderASTVisitor.cpp b/unittests/AST/PostOrderASTVisitor.cpp index ee17f14bd1..2921f3ead5 100644 --- a/unittests/AST/PostOrderASTVisitor.cpp +++ b/unittests/AST/PostOrderASTVisitor.cpp @@ -81,7 +81,7 @@ TEST(RecursiveASTVisitor, PostOrderTraversal) { auto ASTUnit = tooling::buildASTFromCode( "class A {" " class B {" - " int foo() { while(4) { int i = 9; int j = -i; } return (1 + 3) + 2; }" + " int foo() { while(4) { int i = 9; int j = -5; } return (1 + 3) + 2; }" " };" "};" ); @@ -91,9 +91,9 @@ TEST(RecursiveASTVisitor, PostOrderTraversal) { RecordingVisitor Visitor(true); Visitor.TraverseTranslationUnitDecl(TU); - std::vector expected = { - "4", "9", "i", "-", "j", "1", "3", "+", "2", "+", "return", "A::B::foo", "A::B", "A" - }; + std::vector expected = {"4", "9", "i", "5", "-", + "j", "1", "3", "+", "2", + "+", "return", "A::B::foo", "A::B", "A"}; // Compare the list of actually visited nodes // with the expected list of visited nodes. ASSERT_EQ(expected.size(), Visitor.VisitedNodes.size()); -- cgit v1.2.1