summaryrefslogtreecommitdiff
path: root/unittests/AST
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-07 20:38:20 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2016-12-07 20:38:20 +0000
commitb9cb1c8a1ebf52695372de12c7b04c8ef1bd8b4e (patch)
treefafb9c167aac87ee8d9234c79763fd8f59e76f8a /unittests/AST
parented1269004736ca3040a35ada53f3eaa7a10dc1c7 (diff)
downloadclang-b9cb1c8a1ebf52695372de12c7b04c8ef1bd8b4e.tar.gz
[RecursiveASTVisitor] Improve post-order traversal unit test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/AST')
-rw-r--r--unittests/AST/PostOrderASTVisitor.cpp8
1 files changed, 4 insertions, 4 deletions
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<std::string> expected = {
- "4", "9", "i", "-", "j", "1", "3", "+", "2", "+", "return", "A::B::foo", "A::B", "A"
- };
+ std::vector<std::string> 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());