[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:07:16 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=dba4e4b
The following commit has been merged in the master branch:
commit dba4e4b3741ba0469dd2d558fae5772ba0914186
Author: George Goldberg <george.goldberg at collabora.co.uk>
Date: Tue Jan 4 22:25:48 2011 +0000
Account Test: test nickname changes and current presence changes.
---
kpeople/nepomuk-feeder/tests/account-test.cpp | 72 ++++++++++++++++++++++++++-
kpeople/nepomuk-feeder/tests/account-test.h | 6 ++-
2 files changed, 74 insertions(+), 4 deletions(-)
diff --git a/kpeople/nepomuk-feeder/tests/account-test.cpp b/kpeople/nepomuk-feeder/tests/account-test.cpp
index 9a17747..60bdc43 100644
--- a/kpeople/nepomuk-feeder/tests/account-test.cpp
+++ b/kpeople/nepomuk-feeder/tests/account-test.cpp
@@ -49,6 +49,11 @@ AccountTest::~AccountTest()
void AccountTest::initTestCase()
{
initTestCaseImpl();
+}
+
+void AccountTest::init()
+{
+ initImpl();
// Set up the account manager.
Tp::Features fAccountFactory;
@@ -210,9 +215,67 @@ void AccountTest::testInitShutdown()
QCOMPARE(qVariantValue<Tp::SimplePresence>(spyCurrentPresenceChanged2.first().at(1)), p2);
}
-void AccountTest::cleanupTestCase()
+void AccountTest::testOnNicknameChanged()
{
- cleanupTestCaseImpl();
+ // Set up the account object.
+ m_accountObject = new Account(m_account, this);
+ m_accountObject->init();
+
+ // Check the default nickname
+ QCOMPARE(m_account->nickname(), QLatin1String("Bob"));
+
+ // Change the nickname
+ m_account->setNickname(QLatin1String("New Nickname"));
+
+ QSignalSpy spy(m_accountObject, SIGNAL(nicknameChanged(QString,QString)));
+ do {
+ mLoop->processEvents();
+ } while(spy.size() == 0);
+
+ // Check the correct signals were emitted.
+ QCOMPARE(spy.size(), 1);
+ QCOMPARE(spy.first().at(1).toString(), QLatin1String("New Nickname"));
+}
+
+void AccountTest::testOnCurrentPresenceChanged()
+{
+ // Set up the account object.
+ m_accountObject = new Account(m_account, this);
+ m_accountObject->init();
+
+ // Check the default presence
+ Tp::SimplePresence p1;
+ p1.status = QLatin1String("offline");
+ p1.type = Tp::ConnectionPresenceTypeOffline;
+ QCOMPARE(m_account->currentPresence().barePresence(), p1);
+
+ // Change the presence
+ Tp::SimplePresence p2;
+ p2.status = QLatin1String("away");
+ p2.statusMessage = QLatin1String("Not Here");
+ p2.type = Tp::ConnectionPresenceTypeAway;
+ m_account->setRequestedPresence(Tp::Presence(p2));
+
+ QSignalSpy spy(m_accountObject, SIGNAL(currentPresenceChanged(QString,Tp::SimplePresence)));
+ do {
+ mLoop->processEvents();
+ } while(spy.size() == 0);
+
+ // Check the correct signals were emitted.
+ QCOMPARE(spy.size(), 1);
+ QCOMPARE(qVariantValue<Tp::SimplePresence>(spy.first().at(1)), p2);
+}
+
+void AccountTest::cleanup()
+{
+ cleanupImpl();
+
+ // Remove the account from the AM.
+ connect(m_account->remove(),
+ SIGNAL(finished(Tp::PendingOperation*)),
+ mLoop,
+ SLOT(quit()));
+ QCOMPARE(mLoop->exec(), 0);
// Clear TP objects
m_account.reset();
@@ -227,6 +290,11 @@ void AccountTest::cleanupTestCase()
}
}
+void AccountTest::cleanupTestCase()
+{
+ cleanupTestCaseImpl();
+}
+
QTEST_KDEMAIN(AccountTest, GUI)
diff --git a/kpeople/nepomuk-feeder/tests/account-test.h b/kpeople/nepomuk-feeder/tests/account-test.h
index 06114a2..dd53b39 100644
--- a/kpeople/nepomuk-feeder/tests/account-test.h
+++ b/kpeople/nepomuk-feeder/tests/account-test.h
@@ -42,16 +42,18 @@ public Q_SLOTS:
private Q_SLOTS:
void initTestCase();
+ void init();
void testInitShutdown();
//void testOnConnectionStatusChanged();
- //void testOnCurrentPresenceChanged();
- //void testOnNicknameChanged();
+ void testOnCurrentPresenceChanged();
+ void testOnNicknameChanged();
//void testOnAllKnownContactsChanged();
//void testOnNewContact();
//void testOnContactDestroyed();
//void testSignalRelays();
+ void cleanup();
void cleanupTestCase();
private:
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list