Commit 9352ca34 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

change EXPECT_EQ(true, <expression>) to EXPECT_TRUE(<expression>) based on a comment in the ticket.

independent from the purpose of this ticket, but this is probably a good place to make these changes to be consistent with the other set of changes.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac365@3197 e5f2f494-b856-4b98-b285-d166d9295462
parent bf85ae6f
......@@ -348,8 +348,8 @@ TEST_F(AuthSrvTest, unsupportedRequest) {
data[2] = ((i << 3) & 0xff);
parse_message.clear(Message::PARSE);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOTIMP(), i, QR_FLAG,
0, 0, 0, 0);
}
......@@ -367,8 +367,8 @@ TEST_F(AuthSrvTest, verbose) {
// Multiple questions. Should result in FORMERR.
TEST_F(AuthSrvTest, multiQuestion) {
createDataFromFile("multiquestion_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
QR_FLAG, 2, 0, 0, 0);
......@@ -415,8 +415,8 @@ TEST_F(AuthSrvTest, response) {
// Query with a broken question
TEST_F(AuthSrvTest, shortQuestion) {
createDataFromFile("shortquestion_fromWire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
// Since the query's question is broken, the question section of the
// response should be empty.
headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
......@@ -426,8 +426,8 @@ TEST_F(AuthSrvTest, shortQuestion) {
// Query with a broken answer section
TEST_F(AuthSrvTest, shortAnswer) {
createDataFromFile("shortanswer_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
// This is a bogus query, but question section is valid. So the response
// should copy the question section.
......@@ -445,8 +445,8 @@ TEST_F(AuthSrvTest, shortAnswer) {
// Query with unsupported version of EDNS.
TEST_F(AuthSrvTest, ednsBadVers) {
createDataFromFile("queryBadEDNS_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
// The response must have an EDNS OPT RR in the additional section, but
// it will be added automatically at the render time.
......@@ -468,8 +468,8 @@ TEST_F(AuthSrvTest, AXFROverUDP) {
// AXFR over UDP is invalid and should result in FORMERR.
createRequestPacket(opcode, Name("example.com"), RRClass::IN(),
RRType::AXFR(), IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
QR_FLAG, 1, 0, 0, 0);
}
......@@ -542,8 +542,8 @@ TEST_F(AuthSrvTest, notify) {
RRType::SOA());
request_message.setHeaderFlag(MessageFlag::AA());
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
// An internal command message should have been created and sent to an
// external module. Check them.
......@@ -574,8 +574,8 @@ TEST_F(AuthSrvTest, notifyForCHClass) {
RRType::SOA());
request_message.setHeaderFlag(MessageFlag::AA());
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
// Other conditions should be the same, so simply confirm the RR class is
// set correctly.
......@@ -592,8 +592,8 @@ TEST_F(AuthSrvTest, notifyEmptyQuestion) {
request_message.setQid(default_qid);
request_message.toWire(request_renderer);
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::FORMERR(),
Opcode::NOTIFY().getCode(), QR_FLAG, 0, 0, 0, 0);
}
......@@ -606,8 +606,8 @@ TEST_F(AuthSrvTest, notifyMultiQuestions) {
RRType::SOA()));
request_message.setHeaderFlag(MessageFlag::AA());
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::FORMERR(),
Opcode::NOTIFY().getCode(), QR_FLAG, 2, 0, 0, 0);
}
......@@ -617,8 +617,8 @@ TEST_F(AuthSrvTest, notifyNonSOAQuestion) {
RRType::NS());
request_message.setHeaderFlag(MessageFlag::AA());
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::FORMERR(),
Opcode::NOTIFY().getCode(), QR_FLAG, 1, 0, 0, 0);
}
......@@ -627,8 +627,8 @@ TEST_F(AuthSrvTest, notifyWithoutAA) {
// implicitly leave the AA bit off. our implementation will accept it.
createRequestPacket(Opcode::NOTIFY(), Name("example.com"), RRClass::IN(),
RRType::SOA());
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOERROR(),
Opcode::NOTIFY().getCode(), QR_FLAG | AA_FLAG, 1, 0, 0, 0);
}
......@@ -639,8 +639,8 @@ TEST_F(AuthSrvTest, notifyWithErrorRcode) {
request_message.setHeaderFlag(MessageFlag::AA());
request_message.setRcode(Rcode::SERVFAIL());
createRequestPacket(IPPROTO_UDP);
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOERROR(),
Opcode::NOTIFY().getCode(), QR_FLAG | AA_FLAG, 1, 0, 0, 0);
}
......@@ -727,8 +727,8 @@ TEST_F(AuthSrvTest, updateConfig) {
// response should have the AA flag on, and have an RR in each answer
// and authority section.
createDataFromFile("examplequery_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
QR_FLAG | AA_FLAG, 1, 1, 1, 0);
}
......@@ -741,8 +741,8 @@ TEST_F(AuthSrvTest, datasourceFail) {
// in a SERVFAIL response, and the answer and authority sections should
// be empty.
createDataFromFile("badExampleQuery_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::SERVFAIL(),
opcode.getCode(), QR_FLAG, 1, 0, 0, 0);
}
......@@ -756,8 +756,8 @@ TEST_F(AuthSrvTest, updateConfigFail) {
// The original data source should still exist.
createDataFromFile("examplequery_fromWire.wire");
EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
response_renderer));
EXPECT_TRUE(server.processMessage(*io_message, parse_message,
response_renderer));
headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
QR_FLAG | AA_FLAG, 1, 1, 1, 0);
}
......
......@@ -152,7 +152,7 @@ TEST_F(CCSessionTest, parseCommand) {
TEST_F(CCSessionTest, session1) {
EXPECT_FALSE(session.haveSubscription("Spec1", "*"));
ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL);
EXPECT_EQ(true, session.haveSubscription("Spec1", "*"));
EXPECT_TRUE(session.haveSubscription("Spec1", "*"));
EXPECT_EQ(1, session.getMsgQueue()->size());
ConstElementPtr msg;
......@@ -168,7 +168,7 @@ TEST_F(CCSessionTest, session2)
{
EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
ModuleCCSession mccs(ccspecfile("spec2.spec"), session, NULL, NULL);
EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
EXPECT_EQ(1, session.getMsgQueue()->size());
ConstElementPtr msg;
......@@ -215,7 +215,7 @@ TEST_F(CCSessionTest, session3) {
EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler,
my_command_handler);
EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
EXPECT_EQ(2, session.getMsgQueue()->size());
ConstElementPtr msg;
......@@ -239,7 +239,7 @@ TEST_F(CCSessionTest, checkCommand) {
EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler,
my_command_handler);
EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
EXPECT_EQ(2, session.getMsgQueue()->size());
ConstElementPtr msg;
......@@ -341,7 +341,7 @@ TEST_F(CCSessionTest, remoteConfig) {
int item1;
ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL);
EXPECT_EQ(true, session.haveSubscription("Spec1", "*"));
EXPECT_TRUE(session.haveSubscription("Spec1", "*"));
// first simply connect, with no config values, and see we get
// the default
......@@ -350,7 +350,7 @@ TEST_F(CCSessionTest, remoteConfig) {
EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
module_name = mccs.addRemoteConfig(ccspecfile("spec2.spec"));
EXPECT_EQ("Spec2", module_name);
EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
item1 = mccs.getRemoteConfigValue(module_name, "item1")->intValue();
EXPECT_EQ(1, item1);
......@@ -390,7 +390,7 @@ TEST_F(CCSessionTest, ignoreRemoteConfigCommands) {
EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler, my_command_handler);
EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
EXPECT_EQ(2, session.getMsgQueue()->size());
ConstElementPtr msg;
......
......@@ -356,8 +356,8 @@ TEST_F(NameTest, toWireBuffer)
UnitTestUtil::readWireData(string("01610376697803636f6d00"), data);
Name("a.vix.com.").toWire(buffer);
EXPECT_EQ(true, buffer.getLength() == data.size() &&
memcmp(buffer.getData(), &data[0], data.size()) == 0);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, &data[0], data.size(),
buffer.getData(), buffer.getLength());
}
//
......@@ -372,8 +372,8 @@ TEST_F(NameTest, toWireRenderer)
UnitTestUtil::readWireData(string("01610376697803636f6d00"), data);
Name("a.vix.com.").toWire(renderer);
EXPECT_EQ(true, buffer.getLength() == data.size() &&
memcmp(buffer.getData(), &data[0], data.size()) == 0);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, &data[0], data.size(),
buffer.getData(), buffer.getLength());
}
//
......@@ -444,7 +444,7 @@ TEST_F(NameTest, equal) {
TEST_F(NameTest, isWildcard) {
EXPECT_FALSE(example_name.isWildcard());
EXPECT_EQ(true, Name("*.a.example.com").isWildcard());
EXPECT_TRUE(Name("*.a.example.com").isWildcard());
EXPECT_FALSE(Name("a.*.example.com").isWildcard());
}
......
......@@ -118,7 +118,7 @@ TEST_F(Rdata_NS_Test, compare)
{
generic::NS small("a.example");
generic::NS large("example");
EXPECT_EQ(true, Name("a.example") > Name("example"));
EXPECT_TRUE(Name("a.example") > Name("example"));
EXPECT_GT(0, small.compare(large));
}
......
......@@ -122,7 +122,7 @@ TEST_F(Rdata_PTR_Test, compare)
{
generic::PTR small("a.example");
generic::PTR large("example");
EXPECT_EQ(true, Name("a.example") > Name("example"));
EXPECT_TRUE(Name("a.example") > Name("example"));
EXPECT_GT(0, small.compare(large));
}
......
......@@ -298,7 +298,7 @@ TEST_F(RdataTest, compareNames)
// Check the case where the order is different from the owner name
// comparison:
EXPECT_EQ(true, small > large);
EXPECT_TRUE(small > large);
EXPECT_EQ(-1, compareNames(small, large));
EXPECT_EQ(1, compareNames(large, small));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment