Parcourir la source

Test expected behaviour/allowed behaviour

The test was too strict and bound to previous implementation. It is not
strictly required, and is implemented differently now.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac408@3691 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner il y a 14 ans
Parent
commit
145c123caa
1 fichiers modifiés avec 6 ajouts et 17 suppressions
  1. 6 17
      src/lib/nsas/tests/nameserver_entry_unittest.cc

+ 6 - 17
src/lib/nsas/tests/nameserver_entry_unittest.cc

@@ -109,24 +109,13 @@ TEST_F(NameserverEntryTest, InitialRTT) {
     NameserverEntry::AddressVector vec;
     NameserverEntry::AddressVector vec;
     alpha->getAddresses(vec);
     alpha->getAddresses(vec);
 
 
-    // Copy into a vector of time_t.
-    vector<uint32_t> rtt;
-    for (NameserverEntry::AddressVectorIterator i = vec.begin();
-        i != vec.end(); ++i) {
-        rtt.push_back(i->getRTT());
+    // Check they are not 0 and they are all small, they should be some kind
+    // of randomish numbers, so we can't expect much more here
+    BOOST_FOREACH(const AddressEntry& entry, vec) {
+        EXPECT_GT(entry.getRTT(), 0);
+        // 20 is some arbitrary small value
+        EXPECT_LT(entry.getRTT(), 20);
     }
     }
-
-    // Ensure that the addresses are sorted and note how many RTTs we have.
-    sort(rtt.begin(), rtt.end());
-    int oldcount = rtt.size();
-
-    // Remove duplicates and notw the new size.
-    vector<uint32_t>::iterator newend = unique(rtt.begin(), rtt.end());
-    rtt.erase(newend, rtt.end());
-    int newcount = rtt.size();
-
-    // .. and we don't expect to have lost anything.
-    EXPECT_EQ(oldcount, newcount);
 }
 }
 
 
 // Set an address RTT to a given value
 // Set an address RTT to a given value