]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2155] update test case according to the review comment
authorYoshitaka Aharen <aharen@jprs.co.jp>
Fri, 12 Oct 2012 05:21:15 +0000 (14:21 +0900)
committerYoshitaka Aharen <aharen@jprs.co.jp>
Thu, 15 Nov 2012 07:28:27 +0000 (16:28 +0900)
Conflicts:
src/bin/auth/tests/auth_srv_unittest.cc

src/bin/auth/tests/auth_srv_unittest.cc

index d310bd7c4986210769a2a28b68e59a623b32f6d1..5a1ed4586742c58f0eec96a5d3a3f8ca30c437e9 100644 (file)
@@ -131,17 +131,8 @@ protected:
 
     // Checks whether all Rcode counters are set to zero
     void checkAllRcodeCountersZero() const {
-        const std::map<std::string, ConstElementPtr>
-            stats_map(server.getStatistics()->get("zones")->get("_SERVER_")->
-                      get("rcode")->mapValue());
-
-        for (std::map<std::string, ConstElementPtr>::const_iterator
-                 i = stats_map.begin(), e = stats_map.end();
-             i != e;
-             ++i)
-        {
-            checkRcodeCounter(i->first, i->second->intValue(), 0);
-        }
+        // with checking NOERROR == 0 and the others are 0
+        checkAllRcodeCountersZeroExcept(Rcode::NOERROR(), 0);
     }
 
     // Checks whether all Rcode counters are set to zero except the given
@@ -242,6 +233,8 @@ createBuiltinVersionResponse(const qid_t qid, vector<uint8_t>& data) {
                 renderer.getLength());
 }
 
+// Check if the item has expected value.
+// Before reading the item, check the item exists.
 void
 expectCounterItem(ConstElementPtr stats,
                   const std::string& item, const int expected) {