summaryrefslogtreecommitdiffstats
path: root/libkcddb/test/asyncsmtpsubmittest.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
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /libkcddb/test/asyncsmtpsubmittest.cpp
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.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/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcddb/test/asyncsmtpsubmittest.cpp')
-rw-r--r--libkcddb/test/asyncsmtpsubmittest.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/libkcddb/test/asyncsmtpsubmittest.cpp b/libkcddb/test/asyncsmtpsubmittest.cpp
new file mode 100644
index 00000000..224288e3
--- /dev/null
+++ b/libkcddb/test/asyncsmtpsubmittest.cpp
@@ -0,0 +1,81 @@
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+
+#include "asyncsmtpsubmittest.h"
+#include "libkcddb/submit.h"
+
+AsyncSMTPSubmitTest::AsyncSMTPSubmitTest()
+ : QObject()
+{
+ using namespace KCDDB;
+
+ client_ = new Client;
+ client_->config().setSubmitTransport(Submit::SMTP);
+ client_->config().setSubmitAddress("test-submit@freedb.org");
+ client_->setBlockingMode( false );
+
+ TrackOffsetList list;
+
+ list
+ << 150 // First track start.
+ << 2592
+ << 35472
+ << 47891
+ << 123310
+ << 150 // Disc start.
+ << 133125; // Disc end.
+
+ CDInfo cdInfo;
+
+ cdInfo.id = "3606ed05";
+ cdInfo.revision = 4;
+ cdInfo.title = "Bamse och Bronto";
+ cdInfo.artist = "Musiksage";
+ cdInfo.year = 2001;
+ cdInfo.category = "misc";
+ cdInfo.genre = "Barnsaga";
+ cdInfo.extd = QString::fromUtf8("Berättare: Olof Thunberg");
+
+ TrackInfo info;
+ info.title = "Bamses signaturmelodi";
+ cdInfo.trackInfoList.append(info);
+ info.title = "*";
+ cdInfo.trackInfoList.append(info);
+ info.title = "Brummavisan";
+ cdInfo.trackInfoList.append(info);
+ info.title = "*";
+ cdInfo.trackInfoList.append(info);
+ info.title = QString::fromUtf8("Jätteödlan Bronto");
+ cdInfo.trackInfoList.append(info);
+
+ connect
+ (
+ client_,
+ SIGNAL(finished(CDDB::Result)),
+ SLOT(slotFinished(CDDB::Result))
+ );
+
+ client_->submit(cdInfo, list);
+}
+
+ void
+AsyncSMTPSubmitTest::slotFinished(CDDB::Result r)
+{
+ kdDebug() << "AsyncSMTPSubmitTest::slotFinished: Got " << KCDDB::CDDB::resultToString(r) << endl;
+
+ kapp->quit();
+}
+
+int main(int argc, char ** argv)
+{
+ KCmdLineArgs::init(argc, argv, "libkcddb_test", "", "", "");
+
+ KApplication app(false /* No styles */, false /* No GUI */);
+
+ new AsyncSMTPSubmitTest;
+
+ return app.exec();
+}
+
+#include "asyncsmtpsubmittest.moc"