Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame^] | 1 | #include "ClangTidyTest.h" |
| 2 | |
| 3 | #include "google/GoogleTidyModule.h" |
| 4 | |
| 5 | namespace clang { |
| 6 | namespace tidy { |
| 7 | |
| 8 | typedef ClangTidyTest<ExplicitConstructorCheck> ExplicitConstructorCheckTest; |
| 9 | |
| 10 | TEST_F(ExplicitConstructorCheckTest, SingleArgumentConstructorsOnly) { |
| 11 | expectNoChanges("class C { C(); };"); |
| 12 | expectNoChanges("class C { C(int i, int j); };"); |
| 13 | } |
| 14 | |
| 15 | TEST_F(ExplicitConstructorCheckTest, Basic) { |
| 16 | EXPECT_EQ("class C { explicit C(int i); };", |
| 17 | runCheckOn("class C { C(int i); };")); |
| 18 | } |
| 19 | |
| 20 | TEST_F(ExplicitConstructorCheckTest, DefaultParameters) { |
| 21 | EXPECT_EQ("class C { explicit C(int i, int j = 0); };", |
| 22 | runCheckOn("class C { C(int i, int j = 0); };")); |
| 23 | } |
| 24 | |
| 25 | } // namespace tidy |
| 26 | } // namespace clang |