summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-08-10 16:12:04 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-08-10 16:12:04 (GMT)
commitb885ed7a0d0f6ec9d85163da1289f5f238703bf2 (patch)
tree6cf20978164e9b753f1709b169977d5b1d624944
parent140a08bbf2e41df5150062d42bf32de012f6273c (diff)
downloadkolab-utils-b885ed7a0d0f6ec9d85163da1289f5f238703bf2.tar.gz
Get rid of tests which do nothing anyways.
-rw-r--r--CMakeLists.txt7
-rw-r--r--upgradetool/upgradetooltests.cpp131
-rw-r--r--upgradetool/upgradetooltests.h20
3 files changed, 0 insertions, 158 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b68fea1..dde4eb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,13 +70,6 @@ QT4_WRAP_CPP(SRC_MOC
add_executable(kolab-formatupgrade ${UPGRADE_SRCS} ${SRC_MOC} ${JOBS_SRCS})
target_link_libraries(kolab-formatupgrade ${COMMON_DEPENDENCIES})
-#Tests
-include_directories(${QT_INCLUDES} ${QT_INCLUDE_DIR} QtCore)
-# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
-QT4_AUTOMOC(upgradetool/upgradetooltests.cpp)
-add_executable(upgradetooltests upgradetool/upgradetooltests.cpp upgradetool/upgradeutilities.cpp ${CMAKE_CURRENT_BINARY_DIR}/${BINDINGSTEST_MOC})
-target_link_libraries(upgradetooltests ${QT_QTTEST_LIBRARY} ${COMMON_DEPENDENCIES})
-
install(TARGETS kolab-formatupgrade
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
diff --git a/upgradetool/upgradetooltests.cpp b/upgradetool/upgradetooltests.cpp
deleted file mode 100644
index 15242f1..0000000
--- a/upgradetool/upgradetooltests.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "upgradetooltests.h"
-#include "upgradeutilities.h"
-#include <kolabformat.h>
-#include <kolabobject.h>
-#include <kdebug.h>
-#include <kmime/kmime_message.h>
-#include <kcalcore/icalformat.h>
-
-void showDiff(const QString &expected, const QString &converted)
-{
- if (expected.isEmpty() || converted.isEmpty()) {
- kDebug() << "files are emtpy";
- return;
- }
- if (expected == converted) {
- return;
- }
- QTemporaryFile realFile("realFile");
- QTemporaryFile convertedFile("expectedFile");
- if (realFile.open() && convertedFile.open()) {
- realFile.write(expected.toLatin1());
- convertedFile.write(converted.toLatin1());
- realFile.close();
- convertedFile.close();
- QProcess::execute("kompare", QStringList() << "-c" << realFile.fileName() << convertedFile.fileName());
- }
-
- // qDebug() << "EXPECTED: " << expected;
- // qDebug() << "CONVERTED: " << converted;
-}
-
-void UpgradeToolTests::testConvertEvent()
-{
- QFile file( "../testfiles/v2/event/complex.ics.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
- kDebug() << Kolab::Upgrade::upgradeMime(data);
-}
-
-void UpgradeToolTests::testEventUpgrade()
-{
- QFile file( "../testfiles/v2/event/complex.ics.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
-
- //load KCalCore V2
- KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
- msg->setContent( data );
- msg->parse();
- msg->content(KMime::ContentIndex());
-
- Kolab::KolabObjectReader reader;
-
- KMime::Message::Ptr message;
- reader.parseMimeMessage(msg);
- const KCalCore::Event::Ptr &v2result = reader.getEvent();
- QVERIFY(v2result);
-
- //write KCalCore V3
- message = Kolab::KolabObjectWriter::writeEvent(v2result);
-
- kDebug() << message;
-
- //load KCalCore V3
- Kolab::KolabObjectReader reader2;
- QCOMPARE(reader2.parseMimeMessage(message), Kolab::EventObject);
- const KCalCore::Event::Ptr &v3result = reader2.getEvent();
- QVERIFY(v3result);
-
-
- kDebug() <<"--------------------------------------------------------";
- KCalCore::ICalFormat format;
- if ( *(v2result.data()) != *(v3result.data()) ) {
- showDiff(format.toString( v2result.dynamicCast<KCalCore::Incidence>() ), format.toString( v3result.dynamicCast<KCalCore::Incidence>() ));
-// qDebug() << "V2: " << format.toString( v2result.dynamicCast<KCalCore::Incidence>() );
-// qDebug() << "V3: " << format.toString( v3result.dynamicCast<KCalCore::Incidence>() );
- }
- QVERIFY( *(v2result.data()) == *(v3result.data()) );
- kDebug() <<"--------------------------------------------------------";
- //Compare
- QCOMPARE(*v2result, *v3result);
-}
-
-void UpgradeToolTests::testConvertContact()
-{
- QFile file( "../testfiles/v2/contacts/complex.vcf.mime" );
- file.open( QFile::ReadOnly );
- const QByteArray data = file.readAll();
- QVERIFY( !data.isEmpty() );
-// kDebug() << Kolab::Upgrade::upgradeMime(data);
-}
-
-// void UpgradeToolTests::testContactUpgrade()
-// {
-// QFile file( "../testfiles/v2/event/complex.ics.mime" );
-// file.open( QFile::ReadOnly );
-// const QByteArray data = file.readAll();
-// QVERIFY( !data.isEmpty() );
-//
-// //load KCalCore V2
-// KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
-// msg->setContent( data );
-// msg->parse();
-// msg->content(KMime::ContentIndex());
-//
-// Kolab::KolabObjectReader reader;
-//
-// KMime::Message::Ptr message;
-// reader.parseMimeMessage(msg);
-// const KABC::Addressee &v2result = reader.getContact();
-//
-// //write KCalCore V3
-// message = Kolab::KolabObjectWriter::writeContact(v2result);
-//
-// //load KCalCore V3
-// Kolab::KolabObjectReader reader2;
-// reader2.parseMimeMessage(message);
-// const KABC::Addressee &v3result = reader2.getContact();
-//
-// //Compare
-// QCOMPARE(v2result, v3result);
-//
-// }
-
-
-
-QTEST_MAIN( UpgradeToolTests )
-
-#include "upgradetooltests.moc"
diff --git a/upgradetool/upgradetooltests.h b/upgradetool/upgradetooltests.h
deleted file mode 100644
index d2fb351..0000000
--- a/upgradetool/upgradetooltests.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef UPGRADETOOL_TEST_H
-#define UPGRADETOOL_TEST_H
-
-
-#include <QtCore/QObject>
-#include <QtTest/QtTest>
-
-
-class UpgradeToolTests : public QObject
-{
- Q_OBJECT
-private slots:
-
- void testConvertEvent();
- void testEventUpgrade();
- void testConvertContact();
-
-};
-
-#endif