Browse Source

[2432] Move addAndRemove test code to a helper method

Mukund Sivaraman 12 years ago
parent
commit
b5735838a4
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/lib/dns/tests/rrset_collection_unittest.cc

+ 6 - 1
src/lib/dns/tests/rrset_collection_unittest.cc

@@ -104,7 +104,8 @@ TEST_F(RRsetCollectionTest, find) {
     doFind<RRsetCollection, RRsetPtr>(collection, rrclass);
 }
 
-TEST_F(RRsetCollectionTest, addAndRemove) {
+void
+doAddAndRemove(RRsetCollection& collection, const RRClass& rrclass) {
     // foo.example.org/A doesn't exist
     RRsetPtr rrset_found = collection.find(Name("foo.example.org"), rrclass,
                                            RRType::A());
@@ -134,6 +135,10 @@ TEST_F(RRsetCollectionTest, addAndRemove) {
     EXPECT_FALSE(rrset_found);
 }
 
+TEST_F(RRsetCollectionTest, addAndRemove) {
+    doAddAndRemove(collection, rrclass);
+}
+
 TEST_F(RRsetCollectionTest, iteratorTest) {
     // The collection must not be empty.
     RRsetCollection::iterator iter = collection.begin();