summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/smpppdcs/unittest/clienttest.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/smpppdcs/unittest/clienttest.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/smpppdcs/unittest/clienttest.cpp')
-rw-r--r--kopete/plugins/smpppdcs/unittest/clienttest.cpp121
1 files changed, 121 insertions, 0 deletions
diff --git a/kopete/plugins/smpppdcs/unittest/clienttest.cpp b/kopete/plugins/smpppdcs/unittest/clienttest.cpp
new file mode 100644
index 00000000..5affd83c
--- /dev/null
+++ b/kopete/plugins/smpppdcs/unittest/clienttest.cpp
@@ -0,0 +1,121 @@
+/*
+ clienttest.cpp
+
+ Copyright (c) 2006 by Heiko Schaefer <heiko@rangun.de>
+
+ Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; version 2 of the License. *
+ * *
+ *************************************************************************
+*/
+
+#include "smpppdclient.h"
+
+#include "clienttest.h"
+
+ClientTest::ClientTest(const char * name)
+ : KUnitTest::SlotTester(name) {}
+
+ClientTest::~ClientTest() {}
+
+void ClientTest::testInitIsReady() {
+ SMPPPD::Client c;
+ CHECK(c.isReady(), false);
+}
+
+void ClientTest::testAfterConnectIsReady() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ CHECK(c.isReady(), true);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testConnect() {
+ SMPPPD::Client c;
+ CHECK(c.connect("warwar", 3185), true);
+ CHECK(c.connect("localhost", 3185), false);
+}
+
+void ClientTest::testCommunicationBeforeConnect() {
+ SMPPPD::Client c;
+ QStringList l = c.getInterfaceConfigurations();
+
+ CHECK(l.count() == 0, true);
+ CHECK(c.statusInterface("ifcfg0"), false);
+}
+
+void ClientTest::testServerIDBeforeConnect() {
+ SMPPPD::Client c;
+ CHECK(c.serverID(), QString::null);
+}
+
+void ClientTest::testServerVersionBeforeConnect() {
+ SMPPPD::Client c;
+ CHECK(c.serverVersion(), QString::null);
+}
+
+void ClientTest::testCommunicationAfterConnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ CHECK(c.getInterfaceConfigurations().count() > 0, true);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testServerIDAfterConnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ CHECK(c.serverID().isEmpty(), false);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testServerVersionAfterConnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ CHECK(c.serverVersion().isEmpty(), false);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testCommunicationAfterDisconnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ c.disconnect();
+ CHECK(c.getInterfaceConfigurations().count() == 0, true);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testServerIDAfterDisconnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ c.disconnect();
+ CHECK(c.serverID(), QString::null);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+void ClientTest::testServerVersionAfterDisconnect() {
+ SMPPPD::Client c;
+ if(c.connect("warwar", 3185)) {
+ c.disconnect();
+ CHECK(c.serverVersion(), QString::null);
+ } else {
+ SKIP("Test skipped because no smpppd at warwar:3185");
+ }
+}
+
+#include "clienttest.moc"