#include "clang/AST/DataCollection.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Tooling/Tooling.h"
#include "gtest/gtest.h"
usingnamespaceclang;
usingnamespacetooling;
usingnamespaceast_matchers;
namespace {
class StmtDataCollector : public ConstStmtVisitor<StmtDataCollector> { … };
}
namespace {
struct StmtHashMatch : public MatchFinder::MatchCallback { … };
}
static testing::AssertionResult hashStmt(llvm::MD5::MD5Result &Hash,
const StatementMatcher &StmtMatch,
StringRef Code) { … }
static testing::AssertionResult
isStmtHashEqual(const StatementMatcher &StmtMatch, StringRef Code1,
StringRef Code2) { … }
TEST(StmtDataCollector, TestDeclRefExpr) { … }
TEST(StmtDataCollector, TestMemberExpr) { … }
TEST(StmtDataCollector, TestIntegerLiteral) { … }
TEST(StmtDataCollector, TestFloatingLiteral) { … }
TEST(StmtDataCollector, TestStringLiteral) { … }
TEST(StmtDataCollector, TestCXXBoolLiteral) { … }
TEST(StmtDataCollector, TestCharacterLiteral) { … }