diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /unittests/Tooling/RefactoringCallbacksTest.cpp | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'unittests/Tooling/RefactoringCallbacksTest.cpp')
-rw-r--r-- | unittests/Tooling/RefactoringCallbacksTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/Tooling/RefactoringCallbacksTest.cpp b/unittests/Tooling/RefactoringCallbacksTest.cpp index 00eb193..4e30cfd 100644 --- a/unittests/Tooling/RefactoringCallbacksTest.cpp +++ b/unittests/Tooling/RefactoringCallbacksTest.cpp @@ -10,8 +10,8 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Tooling/RefactoringCallbacks.h" -#include "gtest/gtest.h" #include "RewriterTestContext.h" +#include "gtest/gtest.h" namespace clang { namespace tooling { @@ -40,28 +40,28 @@ TEST(RefactoringCallbacksTest, ReplacesStmtsWithString) { std::string Code = "void f() { int i = 1; }"; std::string Expected = "void f() { ; }"; ReplaceStmtWithText Callback("id", ";"); - expectRewritten(Code, Expected, id("id", declarationStatement()), Callback); + expectRewritten(Code, Expected, id("id", declStmt()), Callback); } TEST(RefactoringCallbacksTest, ReplacesStmtsInCalledMacros) { std::string Code = "#define A void f() { int i = 1; }\nA"; std::string Expected = "#define A void f() { ; }\nA"; ReplaceStmtWithText Callback("id", ";"); - expectRewritten(Code, Expected, id("id", declarationStatement()), Callback); + expectRewritten(Code, Expected, id("id", declStmt()), Callback); } TEST(RefactoringCallbacksTest, IgnoresStmtsInUncalledMacros) { std::string Code = "#define A void f() { int i = 1; }"; std::string Expected = "#define A void f() { int i = 1; }"; ReplaceStmtWithText Callback("id", ";"); - expectRewritten(Code, Expected, id("id", declarationStatement()), Callback); + expectRewritten(Code, Expected, id("id", declStmt()), Callback); } TEST(RefactoringCallbacksTest, ReplacesInteger) { std::string Code = "void f() { int i = 1; }"; std::string Expected = "void f() { int i = 2; }"; ReplaceStmtWithText Callback("id", "2"); - expectRewritten(Code, Expected, id("id", expression(integerLiteral())), + expectRewritten(Code, Expected, id("id", expr(integerLiteral())), Callback); } @@ -72,7 +72,7 @@ TEST(RefactoringCallbacksTest, ReplacesStmtWithStmt) { expectRewritten(Code, Expected, id("always-false", conditionalOperator( hasCondition(boolLiteral(equals(false))), - hasFalseExpression(id("should-be", expression())))), + hasFalseExpression(id("should-be", expr())))), Callback); } @@ -82,8 +82,8 @@ TEST(RefactoringCallbacksTest, ReplacesIfStmt) { ReplaceIfStmtWithItsBody Callback("id", true); expectRewritten(Code, Expected, id("id", ifStmt( - hasCondition(implicitCast(hasSourceExpression( - declarationReference(to(variable(hasName("a"))))))))), + hasCondition(implicitCastExpr(hasSourceExpression( + declRefExpr(to(varDecl(hasName("a"))))))))), Callback); } |