diff options
| author | Jonas Toth <development@jonas-toth.eu> | 2020-01-10 16:10:55 +0100 |
|---|---|---|
| committer | Jonas Toth <development@jonas-toth.eu> | 2020-01-10 16:10:55 +0100 |
| commit | cdd05f2aea3b950a4e2c496175117e6b47b2a050 (patch) | |
| tree | 1dcc2dfda93c03c551cd4553f11f8e1361facde2 | |
| parent | 7e02406f6cf180a8c89ce64665660e7cc9dbc23e (diff) | |
| download | bcm5719-llvm-cdd05f2aea3b950a4e2c496175117e6b47b2a050.tar.gz bcm5719-llvm-cdd05f2aea3b950a4e2c496175117e6b47b2a050.zip | |
[NFC] format unittest for ExprMutAnalyzer
This formatting is a preparation for review in
https://reviews.llvm.org/D54943 to separate pure formatting changes from
actual testing changes.
| -rw-r--r-- | clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp index 2c22a5cf9ed..1c3e00ca4ae 100644 --- a/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp +++ b/clang/unittests/Analysis/ExprMutationAnalyzerTest.cpp @@ -882,38 +882,36 @@ TEST(ExprMutationAnalyzerTest, CastToConstRef) { } TEST(ExprMutationAnalyzerTest, CommaExprWithAnAssigment) { - const auto AST = - buildASTFromCodeWithArgs("void f() { int x; int y; (x, y) = 5; }", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs( + "void f() { int x; int y; (x, y) = 5; }", {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("y")), AST->getASTContext()); EXPECT_TRUE(isMutated(Results, AST.get())); } TEST(ExprMutationAnalyzerTest, CommaExprWithDecOp) { - const auto AST = - buildASTFromCodeWithArgs("void f() { int x; int y; (x, y)++; }", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs( + "void f() { int x; int y; (x, y)++; }", {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("y")), AST->getASTContext()); EXPECT_TRUE(isMutated(Results, AST.get())); } TEST(ExprMutationAnalyzerTest, CommaExprWithNonConstMemberCall) { - const auto AST = - buildASTFromCodeWithArgs("class A { public: int mem; void f() { mem ++; } };" - "void fn() { A o1, o2; (o1, o2).f(); }", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs( + "class A { public: int mem; void f() { mem ++; } };" + "void fn() { A o1, o2; (o1, o2).f(); }", + {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("o2")), AST->getASTContext()); EXPECT_TRUE(isMutated(Results, AST.get())); } TEST(ExprMutationAnalyzerTest, CommaExprWithConstMemberCall) { - const auto AST = - buildASTFromCodeWithArgs("class A { public: int mem; void f() const { } };" - "void fn() { A o1, o2; (o1, o2).f(); }", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs( + "class A { public: int mem; void f() const { } };" + "void fn() { A o1, o2; (o1, o2).f(); }", + {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("o2")), AST->getASTContext()); EXPECT_FALSE(isMutated(Results, AST.get())); @@ -957,11 +955,10 @@ TEST(ExprMutationAnalyzerTest, CommaExprParmRef) { } TEST(ExprMutationAnalyzerTest, CommaExprWithAmpersandOp) { - const auto AST = - buildASTFromCodeWithArgs("class A { public: int mem;};" - "void fn () { A o1, o2;" - "void *addr = &(o2, o1); } ", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs("class A { public: int mem;};" + "void fn () { A o1, o2;" + "void *addr = &(o2, o1); } ", + {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("o1")), AST->getASTContext()); EXPECT_TRUE(isMutated(Results, AST.get())); @@ -976,9 +973,8 @@ TEST(ExprMutationAnalyzerTest, CommaExprAsReturnAsValue) { } TEST(ExprMutationAnalyzerTest, CommaEpxrAsReturnAsNonConstRef) { - const auto AST = - buildASTFromCodeWithArgs("int& f() { int x, y; return (y, x); }", - {"-Wno-unused-value"}); + const auto AST = buildASTFromCodeWithArgs( + "int& f() { int x, y; return (y, x); }", {"-Wno-unused-value"}); const auto Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); EXPECT_TRUE(isMutated(Results, AST.get())); @@ -995,13 +991,12 @@ TEST(ExprMutationAnalyzerTest, CommaExprAsArrayToPointerDecay) { } TEST(ExprMutationAnalyzerTest, CommaExprAsUniquePtr) { - const std::string UniquePtrDef = - "template <class T> struct UniquePtr {" - " UniquePtr();" - " UniquePtr(const UniquePtr&) = delete;" - " T& operator*() const;" - " T* operator->() const;" - "};"; + const std::string UniquePtrDef = "template <class T> struct UniquePtr {" + " UniquePtr();" + " UniquePtr(const UniquePtr&) = delete;" + " T& operator*() const;" + " T* operator->() const;" + "};"; const auto AST = buildASTFromCodeWithArgs( UniquePtrDef + "template <class T> void f() " "{ UniquePtr<T> x; UniquePtr<T> y;" |

