ASSERT_EQ(array_lengthof(Text), Toks.size());
for (size_t j = 0, e = Toks.size(); j != e; j++) {
- if(Toks[j].is(tok::text))
+ if(Toks[j].is(tok::text)) {
ASSERT_EQ(StringRef(Text[j]), Toks[j].getText())
<< "index " << i;
+ }
}
}
}
ExpectedName(ExpectedName) {}
void onEndOfTranslationUnit() override {
- if (ExpectedCount != -1)
+ if (ExpectedCount != -1) {
EXPECT_EQ(ExpectedCount, Count);
- if (!ExpectedName.empty())
+ }
+ if (!ExpectedName.empty()) {
EXPECT_EQ(ExpectedName, Name);
+ }
Count = 0;
Name.clear();
}
}
BoundNodes::IDToNodeMap::const_iterator I = M.find(Id);
EXPECT_NE(M.end(), I);
- if (I != M.end())
+ if (I != M.end()) {
EXPECT_EQ(Nodes->getNodeAs<T>(Id), I->second.get<T>());
+ }
return true;
}
EXPECT_TRUE(M.count(Id) == 0 ||
EXPECT_FALSE(EC);
}
~ScopedDir() {
- if (Path != "")
+ if (Path != "") {
EXPECT_FALSE(llvm::sys::fs::remove(Path.str()));
+ }
}
operator StringRef() { return Path.str(); }
};
EXPECT_FALSE(EC);
}
~ScopedLink() {
- if (Path != "")
+ if (Path != "") {
EXPECT_FALSE(llvm::sys::fs::remove(Path.str()));
+ }
}
operator StringRef() { return Path.str(); }
};
Visitor.OnRecordTypeLoc = [&](RecordTypeLoc Type) {
// Filter Types by name since there are other `RecordTypeLoc` in the test
// file.
- if (Type.getDecl()->getQualifiedNameAsString() == "a::b::Foo")
+ if (Type.getDecl()->getQualifiedNameAsString() == "a::b::Foo") {
EXPECT_EQ("x::Bar", replaceRecordTypeLoc(Type, "::a::x::Bar"));
+ }
};
Visitor.runOver("namespace a { namespace b {\n"
"class Foo;\n"
// Filter Types by name since there are other `RecordTypeLoc` in the test
// file.
// `a::b::Foo` in using shadow decl is not `TypeLoc`.
- if (Type.getDecl()->getQualifiedNameAsString() == "a::b::Foo")
+ if (Type.getDecl()->getQualifiedNameAsString() == "a::b::Foo") {
EXPECT_EQ("Bar", replaceRecordTypeLoc(Type, "::a::x::Bar"));
+ }
};
Visitor.runOver("namespace a { namespace b { class Foo {}; } }\n"
"namespace c { using a::b::Foo; Foo f();; }\n");