summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-11 23:04:47 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-11 23:04:47 (GMT)
commit3a39980d887a874e571d59ac0cebda103300c3a5 (patch)
tree9135075403ac35d39b9f638c4a1914177ff3c525 /Swiften/Avatars/UnitTest
parent1e63ca24edf35e5681653189fd6ca107627946f4 (diff)
downloadswift-3a39980d887a874e571d59ac0cebda103300c3a5.zip
swift-3a39980d887a874e571d59ac0cebda103300c3a5.tar.bz2
Fixed unnecessary updating and sending out VCard photo hash.
Diffstat (limited to 'Swiften/Avatars/UnitTest')
-rw-r--r--Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
index 6153d29..3e1cba3 100644
--- a/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
+++ b/Swiften/Avatars/UnitTest/CombinedAvatarProviderTest.cpp
@@ -25,6 +25,7 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testProviderSecondUpdateTriggersChange);
CPPUNIT_TEST(testProviderUpdateWithAvatarDisappearingTriggersChange);
CPPUNIT_TEST(testProviderUpdateAfterAvatarDisappearedTriggersChange);
+ CPPUNIT_TEST(testProviderUpdateAfterGetDoesNotTriggerChange);
CPPUNIT_TEST(testRemoveProviderDisconnectsUpdates);
CPPUNIT_TEST_SUITE_END();
@@ -143,6 +144,18 @@ class CombinedAvatarProviderTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(user1, changes[0]);
}
+
+ void testProviderUpdateAfterGetDoesNotTriggerChange() {
+ std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
+ testling->addProvider(avatarProvider1);
+ avatarProvider1->avatars[user1] = avatarHash1;
+
+ testling->getAvatarHash(user1);
+ avatarProvider1->onAvatarChanged(user1);
+
+ CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(changes.size()));
+ }
+
void testRemoveProviderDisconnectsUpdates() {
std::auto_ptr<CombinedAvatarProvider> testling(createProvider());
testling->addProvider(avatarProvider1);