Parcourir la source

[2155] update test case according to the review comment

Conflicts:
	src/bin/auth/tests/auth_srv_unittest.cc
Yoshitaka Aharen il y a 12 ans
Parent
commit
fb246fec83
1 fichiers modifiés avec 4 ajouts et 11 suppressions
  1. 4 11
      src/bin/auth/tests/auth_srv_unittest.cc

+ 4 - 11
src/bin/auth/tests/auth_srv_unittest.cc

@@ -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) {