Files
llvm-project/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
Daniel Jasper d07c840e6a Initial architecture for clang-tidy.
This is the first version of a possible clang-tidy architecture. The
purpose of clang-tidy is to detect errors in adhering to common coding
patterns, e.g. described in the LLVM Coding Standards.

This is still heavily in flux.

Review: http://llvm-reviews.chandlerc.com/D884
llvm-svn: 187345
2013-07-29 08:19:24 +00:00

27 lines
716 B
C++

#include "ClangTidyTest.h"
#include "google/GoogleTidyModule.h"
namespace clang {
namespace tidy {
typedef ClangTidyTest<ExplicitConstructorCheck> ExplicitConstructorCheckTest;
TEST_F(ExplicitConstructorCheckTest, SingleArgumentConstructorsOnly) {
expectNoChanges("class C { C(); };");
expectNoChanges("class C { C(int i, int j); };");
}
TEST_F(ExplicitConstructorCheckTest, Basic) {
EXPECT_EQ("class C { explicit C(int i); };",
runCheckOn("class C { C(int i); };"));
}
TEST_F(ExplicitConstructorCheckTest, DefaultParameters) {
EXPECT_EQ("class C { explicit C(int i, int j = 0); };",
runCheckOn("class C { C(int i, int j = 0); };"));
}
} // namespace tidy
} // namespace clang