From: JINMEI Tatuya Date: Fri, 24 Aug 2012 01:29:20 +0000 (-0700) Subject: [2178] fixed build error about EXPECT_EQ due to missing operator<< X-Git-Tag: trac2351_base~118^2~1^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e0eaa46295536f7ed4175fd6d9caeb5f5192a5c;p=thirdparty%2Fkea.git [2178] fixed build error about EXPECT_EQ due to missing operator<< using EXPECT_EQ(==) instead. --- diff --git a/src/lib/datasrc/tests/client_list_unittest.cc b/src/lib/datasrc/tests/client_list_unittest.cc index fc571d9dfd..3ca906b0d3 100644 --- a/src/lib/datasrc/tests/client_list_unittest.cc +++ b/src/lib/datasrc/tests/client_list_unittest.cc @@ -332,7 +332,7 @@ public: shared_ptr()); } shared_ptr list_; - const ClientList::FindResult negativeResult_; + const ClientList::FindResult negative_result_; vector > ds_; vector ds_info_; const ConstElementPtr config_elem_, config_elem_zones_; @@ -349,7 +349,7 @@ TEST_F(ListTest, selfTest) { EXPECT_EQ(result::NOTFOUND, ds_[0]->findZone(Name("zzz")).code); // Nothing to keep alive here. EXPECT_EQ(shared_ptr(), - negativeResult_.life_keeper_); + negative_result_.life_keeper_); } // Test the list we create with empty configuration is, in fact, empty @@ -365,14 +365,14 @@ TEST_F(ListTest, emptySearch) { // Note: we don't have operator<< for the result class, so we cannot use // EXPECT_EQ. Same for other similar cases. - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), false, - false)); - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), false, - true)); - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), true, - false)); - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), true, - true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), false, + false)); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), false, + true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), true, + false)); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), true, + true)); } // Put a single data source inside the list and check it can find an @@ -380,21 +380,21 @@ TEST_F(ListTest, emptySearch) { TEST_F(ListTest, singleDSExactMatch) { list_->getDataSources().push_back(ds_info_[0]); // This zone is not there - EXPECT_TRUE(negativeResult_ == list_->find(Name("org."), true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("org."), true)); // But this one is, so check it. positiveResult(list_->find(Name("example.org"), true), ds_[0], Name("example.org"), true, "Exact match"); // When asking for a sub zone of a zone there, we get nothing // (we want exact match, this would be partial one) - EXPECT_TRUE(negativeResult_ == list_->find(Name("sub.example.org."), - true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("sub.example.org."), + true)); } // When asking for a partial match, we get all that the exact one, but more. TEST_F(ListTest, singleDSBestMatch) { list_->getDataSources().push_back(ds_info_[0]); // This zone is not there - EXPECT_TRUE(negativeResult_ == list_->find(Name("org."))); + EXPECT_TRUE(negative_result_ == list_->find(Name("org."))); // But this one is, so check it. positiveResult(list_->find(Name("example.org")), ds_[0], Name("example.org"), true, "Exact match"); @@ -417,7 +417,7 @@ TEST_F(ListTest, multiExactMatch) { SCOPED_TRACE(test_names[i]); multiConfiguration(i); // Something that is nowhere there - EXPECT_TRUE(negativeResult_ == list_->find(Name("org."), true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("org."), true)); // This one is there exactly. positiveResult(list_->find(Name("example.org"), true), ds_[0], Name("example.org"), true, "Exact match"); @@ -425,7 +425,7 @@ TEST_F(ListTest, multiExactMatch) { positiveResult(list_->find(Name("sub.example.org."), true), ds_[1], Name("sub.example.org"), true, "Subdomain match"); // But this one is in neither data source. - EXPECT_TRUE(negativeResult_ == + EXPECT_TRUE(negative_result_ == list_->find(Name("sub.example.com."), true)); } } @@ -436,7 +436,7 @@ TEST_F(ListTest, multiBestMatch) { SCOPED_TRACE(test_names[i]); multiConfiguration(i); // Something that is nowhere there - EXPECT_TRUE(negativeResult_ == list_->find(Name("org."))); + EXPECT_TRUE(negative_result_ == list_->find(Name("org."))); // This one is there exactly. positiveResult(list_->find(Name("example.org")), ds_[0], Name("example.org"), true, "Exact match"); @@ -712,7 +712,7 @@ TEST_F(ListTest, cacheZones) { positiveResult(list_->find(Name("sub.example.com.")), ds_[0], Name("example.com."), false, "Subdomain of com", true); // For now, the ones not cached are ignored. - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.cz."))); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.cz."))); } // Check the caching handles misbehaviour from the data source and @@ -806,8 +806,8 @@ TEST_F(ListTest, BadMasterFile) { positiveResult(list_->find(Name("example.com."), true), ds_[0], Name("example.com."), true, "example.com", true); - EXPECT_EQ(negativeResult_, list_->find(Name("example.org."), true)); - EXPECT_EQ(negativeResult_, list_->find(Name("foo.bar"), true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("example.org."), true)); + EXPECT_TRUE(negative_result_ == list_->find(Name("foo.bar"), true)); positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "root", true); }