summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-04-23 16:11:21 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-04-23 16:11:21 (GMT)
commit7bd058600b682781abb3fd93bfaf516e7d8d7b23 (patch)
tree56ee7619b3785ff09a15ffdb54ac6427cd052dbf /Swiften/Network/UnitTest
parent00981790bc39e9a0674feec19ffa792329bb077c (diff)
downloadswift-contrib-7bd058600b682781abb3fd93bfaf516e7d8d7b23.zip
swift-contrib-7bd058600b682781abb3fd93bfaf516e7d8d7b23.tar.bz2
Another fix for SRV selection.
Diffstat (limited to 'Swiften/Network/UnitTest')
-rw-r--r--Swiften/Network/UnitTest/DomainNameServiceQueryTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Swiften/Network/UnitTest/DomainNameServiceQueryTest.cpp b/Swiften/Network/UnitTest/DomainNameServiceQueryTest.cpp
index aefd815..53b9413 100644
--- a/Swiften/Network/UnitTest/DomainNameServiceQueryTest.cpp
+++ b/Swiften/Network/UnitTest/DomainNameServiceQueryTest.cpp
@@ -16,14 +16,14 @@ using namespace Swift;
namespace {
struct RandomGenerator1 : public RandomGenerator {
- virtual int generateWeighedRandomNumber(std::vector<double>::const_iterator, std::vector<double>::const_iterator) {
+ virtual int generateRandomInteger(int) {
return 0;
}
};
struct RandomGenerator2 : public RandomGenerator {
- virtual int generateWeighedRandomNumber(std::vector<double>::const_iterator probabilities_begin, std::vector<double>::const_iterator probabilities_end) {
- return std::max_element(probabilities_begin, probabilities_end) - probabilities_begin;
+ virtual int generateRandomInteger(int i) {
+ return i;
}
};
}
@@ -70,9 +70,9 @@ class DomainNameServiceQueryTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("server5.com"), results[0].hostname);
CPPUNIT_ASSERT_EQUAL(std::string("server7.com"), results[1].hostname);
- CPPUNIT_ASSERT_EQUAL(std::string("server4.com"), results[2].hostname);
- CPPUNIT_ASSERT_EQUAL(std::string("server6.com"), results[3].hostname);
- CPPUNIT_ASSERT_EQUAL(std::string("server2.com"), results[4].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("server2.com"), results[2].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("server4.com"), results[3].hostname);
+ CPPUNIT_ASSERT_EQUAL(std::string("server6.com"), results[4].hostname);
CPPUNIT_ASSERT_EQUAL(std::string("server1.com"), results[5].hostname);
CPPUNIT_ASSERT_EQUAL(std::string("server3.com"), results[6].hostname);
}