summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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);