[svn] commit: r3197 - in /branches/trac365/src: bin/auth/tests/ lib/config/tests/ lib/dns/tests/

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Oct 13 07:07:56 UTC 2010


Author: jinmei
Date: Wed Oct 13 07:07:55 2010
New Revision: 3197

Log:
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.

Modified:
    branches/trac365/src/bin/auth/tests/auth_srv_unittest.cc
    branches/trac365/src/lib/config/tests/ccsession_unittests.cc
    branches/trac365/src/lib/dns/tests/name_unittest.cc
    branches/trac365/src/lib/dns/tests/rdata_ns_unittest.cc
    branches/trac365/src/lib/dns/tests/rdata_ptr_unittest.cc
    branches/trac365/src/lib/dns/tests/rdata_unittest.cc

Modified: branches/trac365/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- branches/trac365/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ branches/trac365/src/bin/auth/tests/auth_srv_unittest.cc Wed Oct 13 07:07:55 2010
@@ -348,8 +348,8 @@
         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 @@
 // 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 @@
 // 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 @@
 // 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 @@
 // 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 @@
     // 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 @@
                         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 @@
                         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 @@
     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 @@
                                          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 @@
                         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 @@
     // 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 @@
     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 @@
     // 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 @@
     // 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 @@
 
     // 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);
 }

Modified: branches/trac365/src/lib/config/tests/ccsession_unittests.cc
==============================================================================
--- branches/trac365/src/lib/config/tests/ccsession_unittests.cc (original)
+++ branches/trac365/src/lib/config/tests/ccsession_unittests.cc Wed Oct 13 07:07:55 2010
@@ -152,7 +152,7 @@
 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 @@
 {
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
     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;

Modified: branches/trac365/src/lib/dns/tests/name_unittest.cc
==============================================================================
--- branches/trac365/src/lib/dns/tests/name_unittest.cc (original)
+++ branches/trac365/src/lib/dns/tests/name_unittest.cc Wed Oct 13 07:07:55 2010
@@ -356,8 +356,8 @@
 
     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 @@
 
     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, 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());
 }
 

Modified: branches/trac365/src/lib/dns/tests/rdata_ns_unittest.cc
==============================================================================
--- branches/trac365/src/lib/dns/tests/rdata_ns_unittest.cc (original)
+++ branches/trac365/src/lib/dns/tests/rdata_ns_unittest.cc Wed Oct 13 07:07:55 2010
@@ -118,7 +118,7 @@
 {
     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));
 }
 

Modified: branches/trac365/src/lib/dns/tests/rdata_ptr_unittest.cc
==============================================================================
--- branches/trac365/src/lib/dns/tests/rdata_ptr_unittest.cc (original)
+++ branches/trac365/src/lib/dns/tests/rdata_ptr_unittest.cc Wed Oct 13 07:07:55 2010
@@ -122,7 +122,7 @@
 {
     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));
 }
 

Modified: branches/trac365/src/lib/dns/tests/rdata_unittest.cc
==============================================================================
--- branches/trac365/src/lib/dns/tests/rdata_unittest.cc (original)
+++ branches/trac365/src/lib/dns/tests/rdata_unittest.cc Wed Oct 13 07:07:55 2010
@@ -298,7 +298,7 @@
 
     // 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));
 




More information about the bind10-changes mailing list