[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepimlibs/frameworks] /: It was moved. Remove include
From: Montel Laurent <montel () kde ! org>
Date: 2014-08-07 22:17:20
Message-ID: E1XFVzs-0000p9-VA () scm ! kde ! org
[Download RAW message or body]
Git commit ee8611974bf291e4c4eeac7f0e3229c14554b0ba by Montel Laurent.
Committed on 07/08/2014 at 22:16.
Pushed by mlaurent into branch 'frameworks'.
It was moved. Remove include
M +0 -1 akonadi-contact/src/kcm/kcmakonadicontactactions.cpp
M +0 -1 akonadi-contact/tests/emailaddressselectiondialogtest.cpp
M +0 -1 akonadi-contact/tests/emailaddressselectionwidgettest.cpp
D +0 -18 kcalcore/tests/CMakeLists.txt
D +0 -103 kcalcore/tests/incidencestest.cpp
D +0 -101 kcalcore/tests/readandwrite.cpp
D +0 -170 kcalcore/tests/testrecurprevious.cpp
D +0 -156 kcalcore/tests/testrecurrence.cpp
D +0 -156 kcalcore/tests/testrecurrencetype.cpp
D +0 -123 kcalcore/tests/testrecurson.cpp
D +0 -93 kcalcore/tests/testvcalexport.cpp
http://commits.kde.org/kdepimlibs/ee8611974bf291e4c4eeac7f0e3229c14554b0ba
diff --git a/akonadi-contact/src/kcm/kcmakonadicontactactions.cpp \
b/akonadi-contact/src/kcm/kcmakonadicontactactions.cpp index \
993cfe9..21ed078 100644
--- a/akonadi-contact/src/kcm/kcmakonadicontactactions.cpp
+++ b/akonadi-contact/src/kcm/kcmakonadicontactactions.cpp
@@ -35,7 +35,6 @@
Q_DECLARE_METATYPE(ContactActionsSettings::EnumDialPhoneNumberAction)
K_PLUGIN_FACTORY(KCMAkonadiContactActionsFactory, \
registerPlugin<KCMAkonadiContactActions>();)
-K_EXPORT_PLUGIN(KCMAkonadiContactActionsFactory("kcm_akonadicontact_actions"))
KCMAkonadiContactActions::KCMAkonadiContactActions(QWidget *parent, const \
QVariantList &args) : KCModule(parent)
diff --git a/akonadi-contact/tests/emailaddressselectiondialogtest.cpp \
b/akonadi-contact/tests/emailaddressselectiondialogtest.cpp index \
3626604..dba5a9d 100644
--- a/akonadi-contact/tests/emailaddressselectiondialogtest.cpp
+++ b/akonadi-contact/tests/emailaddressselectiondialogtest.cpp
@@ -22,7 +22,6 @@
#include <kaboutdata.h>
#include <qapplication.h>
-#include <kcmdlineargs.h>
#include <klocalizedstring.h>
int main(int argc, char **argv)
diff --git a/akonadi-contact/tests/emailaddressselectionwidgettest.cpp \
b/akonadi-contact/tests/emailaddressselectionwidgettest.cpp index \
76a9897..e618964 100644
--- a/akonadi-contact/tests/emailaddressselectionwidgettest.cpp
+++ b/akonadi-contact/tests/emailaddressselectionwidgettest.cpp
@@ -23,7 +23,6 @@
#include <kaboutdata.h>
#include <qapplication.h>
#include <kcombobox.h>
-#include <kcmdlineargs.h>
#include <qtextbrowser.h>
#include <klocale.h>
diff --git a/kcalcore/tests/CMakeLists.txt b/kcalcore/tests/CMakeLists.txt
deleted file mode 100644
index baf620f..0000000
--- a/kcalcore/tests/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-include(ECMMarkAsTest)
-
-set(QT_REQUIRED_VERSION "5.2.0")
-find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
-
-
-macro(macro_unit_tests)
- foreach(_testname ${ARGN})
- add_executable(${_testname} ${_testname}.cpp)
- add_test(${_testname} ${_testname})
- ecm_mark_as_test(${_testname})
- target_link_libraries(${_testname} KF5CalendarCore Qt5::Test)
- endforeach()
-endmacro()
-
-macro_unit_tests(
- incidencestest readandwrite testrecurprevious testrecurrence \
testrecurrencetype testrecurson testvcalexport
-)
diff --git a/kcalcore/tests/incidencestest.cpp \
b/kcalcore/tests/incidencestest.cpp deleted file mode 100644
index 56f98ca..0000000
--- a/kcalcore/tests/incidencestest.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "icalformat.h"
-#include "event.h"
-#include "todo.h"
-
-#include <kaboutdata.h>
-#include <kcomponentdata.h>
-#include <qdebug.h>
-#include <KLocalizedString>
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
-
- KAboutData about(QStringLiteral("testincidence"),
- i18n("Test Incidence"), QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testincidence"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
- // KComponentData componentData(&about); // needed by KConfig used \
by KSaveFile TODO: still needed ?
-
- const bool verbose = parser.isSet("verbose");
-
- ICalFormat f;
-
- Event::Ptr event1 = Event::Ptr(new Event);
- event1->setSummary("Test Event");
- event1->recurrence()->setDaily(2);
- event1->recurrence()->setDuration(3);
-
- QString eventString1 = f.toString(event1.staticCast<Incidence>());
- if (verbose) {
- qDebug() << "EVENT1 START:" << eventString1 << "EVENT1 END";
- }
-
- event1->setSchedulingID("foo");
- Incidence::Ptr event2 = Incidence::Ptr(event1->clone());
-
- Q_ASSERT(event1->uid() == event2->uid());
- Q_ASSERT(event1->schedulingID() == event2->schedulingID());
-
- QString eventString2 = f.toString(event2.staticCast<Incidence>());
- if (verbose) {
- qDebug() << "EVENT2 START:" << eventString2 << "EVENT2 END";
- }
-
- if (eventString1 != eventString2) {
- qDebug() << "Clone Event FAILED.";
- } else {
- qDebug() << "Clone Event SUCCEEDED.";
- }
-
- Todo::Ptr todo1 = Todo::Ptr(new Todo);
- todo1->setSummary("Test todo");
- QString todoString1 = f.toString(todo1.staticCast<Incidence>());
- if (verbose) {
- qDebug() << "todo1 START:" << todoString1 << "todo1 END";
- }
-
- Incidence::Ptr todo2 = Incidence::Ptr(todo1->clone());
- QString todoString2 = f.toString(todo2);
- if (verbose) {
- qDebug() << "todo2 START:" << todoString2 << "todo2 END";
- }
-
- if (todoString1 != todoString2) {
- qDebug() << "Clone Todo FAILED.";
- } else {
- qDebug() << "Clone Todo SUCCEEDED.";
- }
-}
diff --git a/kcalcore/tests/readandwrite.cpp \
b/kcalcore/tests/readandwrite.cpp deleted file mode 100644
index a5fd231..0000000
--- a/kcalcore/tests/readandwrite.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "icalformat.h"
-#include "memorycalendar.h"
-#include "vcalformat.h"
-#include "config-kcalcore.h"
-
-#include <kaboutdata.h>
-#include <qdebug.h>
-#include <kcomponentdata.h>
-#include <kcmdlineargs.h>
-
-#include <QtCore/QFileInfo>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("source", i18n("Source file to copy."));
- parser.addPositionalArgument("destination", i18n("Destination \
directory."));
-
- KAboutData about(QStringLiteral("readandwrite"),
- i18n("Read and Write Calendar"), \
QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("readandwrite"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
- // KComponentData componentData(&about); // needed by KConfig used \
by KSaveFile TODO: still needed ?
-
- const QStringList parsedArgs = parser.positionalArguments();
- if (parsedArgs.count() != 2) {
- parser.showHelp();
- }
-
- QString input = parsedArgs[0];
- QString output = parsedArgs[1];
-
- QFileInfo outputFileInfo(output);
- output = outputFileInfo.absoluteFilePath();
-
- qDebug() << "Input file:" << input;
- qDebug() << "Output file:" << output;
-
-#ifdef USE_ICAL_0_46
- // Jenkins is still running a old libical version.
- // Add a workaround here since sysadmins don't have time to install \
libical 1.x before
- // the 4.11 KDE release.
- if (outputFileInfo.fileName() == \
QLatin1String("KOrganizer_3.1.ics.ical.out") ||
- outputFileInfo.fileName() == \
QLatin1String("KOrganizer_3.2.ics.ical.out")) {
- return 0;
- }
-#endif
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
- FileStorage instore(cal, input);
-
- if (!instore.load()) {
- qDebug() << "DAMN";
- return 1;
- }
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- cal->setViewTimeZoneId(tz);
- }
-
- FileStorage outstore(cal, output);
- if (!outstore.save()) {
- return 1;
- }
-
- return 0;
-}
diff --git a/kcalcore/tests/testrecurprevious.cpp \
b/kcalcore/tests/testrecurprevious.cpp deleted file mode 100644
index 97f2c46..0000000
--- a/kcalcore/tests/testrecurprevious.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
- Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofe.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "memorycalendar.h"
-
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcomponentdata.h>
-#include <qdebug.h>
-#include <ksystemtimezone.h>
-#include <KLocalizedString>
-
-#include <QtCore/QFile>
-#include <QtCore/QTextStream>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-static QString dumpTime(const KDateTime &dt, const KDateTime::Spec \
&viewSpec);
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("input", i18n("Name of input file"));
- parser.addPositionalArgument("output", i18n("optional name of output \
file for the recurrence dates"));
-
- KAboutData about(QStringLiteral("testrecurrencenew"),
- i18n("Load recurrence rules with the new class and \
print out debug messages"),
- QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testrecurrencenew"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
-
- QStringList parsedArgs = parser.positionalArguments();
-
- if (parsedArgs.isEmpty()) {
- parser.showHelp();
- }
- QString input = parsedArgs[0];
- qDebug() << "Input file:" << input;
-
- QTextStream *outstream;
- outstream = 0;
- QString fn("");
- if (parsedArgs.count() > 1) {
- fn = parsedArgs[1];
- qDebug() << "We have a file name given:" << fn;
- }
- QFile outfile(fn);
- if (!fn.isEmpty() && outfile.open(QIODevice::WriteOnly)) {
- qDebug() << "Opened output file!!!";
- outstream = new QTextStream(&outfile);
- }
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
-
- KDateTime::Spec viewSpec;
- FileStorage store(cal, input);
- if (!store.load()) return 1;
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- viewSpec = KDateTime::Spec(KSystemTimeZones::zone(tz));
- }
-
- Incidence::List inc = cal->incidences();
-
- for (Incidence::List::Iterator it = inc.begin(); it != inc.end(); \
++it) {
- Incidence::Ptr incidence = *it;
- qDebug() << "*+*+*+*+*+*+*+*+*+*";
- qDebug() << " ->" << incidence->summary() << "<-";
-
- incidence->recurrence()->dump();
-
- KDateTime dt(incidence->recurrence()->endDateTime());
- int i = 0;
- if (outstream) {
- if (!dt.isValid()) {
- if (viewSpec.isValid()) {
- dt = KDateTime(QDate(2011, 1, 1), QTime(0, 0, 1), \
viewSpec);
- } else {
- dt = KDateTime(QDate(2011, 1, 1), QTime(0, 0, 1));
- }
- } else {
- dt = dt.addYears(2);
- }
- qDebug() << "-------------------------------------------";
- qDebug() << " *~*~*~*~ Starting with date:" << dumpTime(dt, \
viewSpec);
- // Output to file for testing purposes
- while (dt.isValid() && i < 500) {
- ++i;
- dt = incidence->recurrence()->getPreviousDateTime(dt);
- if (dt.isValid()) {
- (*outstream) << dumpTime(dt, viewSpec) << endl;
- }
- }
- } else {
- if (!dt.isValid()) {
- dt = KDateTime(QDate(2005, 7, 31), QTime(23, 59, 59), \
KDateTime::Spec::UTC());
- } else {
- dt = dt.addYears(2);
- }
- incidence->recurrence()->dump();
- qDebug() << "-------------------------------------------";
- qDebug() << " *~*~*~*~ Starting with date:" << dumpTime(dt, \
viewSpec);
- // Output to konsole
- while (dt.isValid() && i < 50) {
- ++i;
- qDebug() << "-------------------------------------------";
- dt = incidence->recurrence()->getPreviousDateTime(dt);
- if (dt.isValid()) {
- qDebug() << " *~*~*~*~ Previous date is:" << \
dumpTime(dt, viewSpec);
- }
- }
- }
- }
-
- delete outstream;
- outfile.close();
- return 0;
-}
-
-QString dumpTime(const KDateTime &dt, const KDateTime::Spec &viewSpec)
-{
- if (!dt.isValid()) {
- return QString();
- }
- KDateTime vdt = viewSpec.isValid() ? dt.toTimeSpec(viewSpec) : dt;
- QString format;
-#ifdef FLOAT_IS_DATE_ONLY
- if (vdt.isDateOnly()) {
- format = QStringLiteral("%Y-%m-%d");
- } else
-#endif
- format = QStringLiteral("%Y-%m-%dT%H:%M:%S");
- if (vdt.isSecondOccurrence()) {
- format += QStringLiteral(" %Z");
- }
- if (vdt.timeSpec() != KDateTime::ClockTime) {
- format += QStringLiteral(" %:Z");
- }
- return vdt.toString(format);
-}
diff --git a/kcalcore/tests/testrecurrence.cpp \
b/kcalcore/tests/testrecurrence.cpp deleted file mode 100644
index 377cdc6..0000000
--- a/kcalcore/tests/testrecurrence.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
- Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofe.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "memorycalendar.h"
-
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcomponentdata.h>
-#include <kdatetime.h>
-#include <qdebug.h>
-#include <ksystemtimezone.h>
-
-#include <QtCore/QFile>
-#include <QtCore/QTextStream>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-static QString dumpTime(const KDateTime &dt, const KDateTime::Spec \
&viewSpec);
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("input", i18n("Name of input file"));
- parser.addPositionalArgument("output", i18n("optional name of output \
file for the recurrence dates"));
-
- KAboutData about(QStringLiteral("testrecurrencenew"),
- i18n("Load recurrence rules with the new class and \
print out debug messages"),
- QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testrecurrencenew"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
-
- const QStringList parsedArgs = parser.positionalArguments();
- if (parsedArgs.isEmpty()) {
- parser.showHelp();
- }
-
- QString input = parsedArgs[0];
- qDebug() << "Input file:" << input;
-
- QTextStream *outstream = 0;
- QString fn;
- if (parsedArgs.count() > 1) {
- fn = parsedArgs[1];
- qDebug() << "We have a file name given:" << fn;
- }
- QFile outfile(fn);
- if (!fn.isEmpty() && outfile.open(QIODevice::WriteOnly)) {
- qDebug() << "Opened output file!!!";
- outstream = new QTextStream(&outfile);
- }
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
-
- KDateTime::Spec viewSpec;
- FileStorage store(cal, input);
- if (!store.load()) return 1;
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- viewSpec = KDateTime::Spec(KSystemTimeZones::zone(tz));
- }
-
- Incidence::List inc = cal->incidences();
-
- for (Incidence::List::Iterator it = inc.begin(); it != inc.end(); \
++it) {
- Incidence::Ptr incidence = *it;
- qDebug() << "*+*+*+*+*+*+*+*+*+*";
- qDebug() << " ->" << incidence->summary() << "<-";
-
- incidence->recurrence()->dump();
-
- KDateTime dt;
- if (incidence->allDay()) {
- dt = incidence->dtStart().addDays(-1);
- } else {
- dt = incidence->dtStart().addSecs(-1);
- }
- int i=0;
- if (outstream) {
- // Output to file for testing purposes
- while (dt.isValid() && i < 500) {
- ++i;
- dt = incidence->recurrence()->getNextDateTime(dt);
- if (dt.isValid()) {
- (*outstream) << dumpTime(dt, viewSpec) << endl;
- }
- }
- } else {
- incidence->recurrence()->dump();
- // Output to konsole
- while (dt.isValid() && i < 10) {
- ++i;
- qDebug() << "-------------------------------------------";
- dt = incidence->recurrence()->getNextDateTime(dt);
- if (dt.isValid()) {
- qDebug() << " *~*~*~*~ Next date is:" << dumpTime(dt, \
viewSpec);
- }
- }
- }
- }
-
- delete outstream;
- outfile.close();
- return 0;
-}
-
-QString dumpTime(const KDateTime &dt, const KDateTime::Spec &viewSpec)
-{
- if (!dt.isValid()) {
- return QString();
- }
- KDateTime vdt = viewSpec.isValid() ? dt.toTimeSpec(viewSpec) : dt;
- QString format;
-#ifdef FLOAT_IS_DATE_ONLY
- if (vdt.isDateOnly()) {
- format = QStringLiteral("%Y-%m-%d");
- } else
-#endif
- format = QStringLiteral("%Y-%m-%dT%H:%M:%S");
- if (vdt.isSecondOccurrence()) {
- format += QStringLiteral(" %Z");
- }
- if (vdt.timeSpec() != KDateTime::ClockTime) {
- format += QStringLiteral(" %:Z");
- }
- return vdt.toString(format);
-}
diff --git a/kcalcore/tests/testrecurrencetype.cpp \
b/kcalcore/tests/testrecurrencetype.cpp deleted file mode 100644
index fe113e4..0000000
--- a/kcalcore/tests/testrecurrencetype.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
- Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofe.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "memorycalendar.h"
-
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcomponentdata.h>
-#include <qdebug.h>
-#include <ksystemtimezone.h>
-
-#include <QtCore/QFile>
-#include <QtCore/QTextStream>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-static QString dumpTime(const KDateTime &dt, const KDateTime::Spec \
&viewSpec);
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("input", i18n("Name of input file"));
- parser.addPositionalArgument("output", i18n("optional name of output \
file for the recurrence dates"));
-
- KAboutData about(QStringLiteral("testrecurrencenew"),
- i18n("Load recurrence rules with the new class and \
print out debug messages"),
- QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testrecurrencenew"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
-
- const QStringList parsedArgs = parser.positionalArguments();
-
- if (parsedArgs.isEmpty()) {
- parser.showHelp();
- }
-
- QString input = parsedArgs[0];
- qDebug() << "Input file:" << input;
-
- QTextStream *outstream = 0;
- QString fn;
- if (parsedArgs.count() > 1) {
- fn = parsedArgs[1];
- qDebug() << "We have a file name given:" << fn;
- }
- QFile outfile(fn);
- if (!fn.isEmpty() && outfile.open(QIODevice::WriteOnly)) {
- qDebug() << "Opened output file!!!";
- outstream = new QTextStream(&outfile);
- }
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
-
- KDateTime::Spec viewSpec;
- FileStorage store(cal, input);
- if (!store.load()) return 1;
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- viewSpec = KDateTime::Spec(KSystemTimeZones::zone(tz));
- }
-
- Incidence::List inc = cal->incidences();
-
- for (Incidence::List::Iterator it = inc.begin(); it != inc.end(); \
++it) {
- Incidence::Ptr incidence = *it;
- qDebug() << "*+*+*+*+*+*+*+*+*+*";
- qDebug() << " ->" << incidence->summary() << "<-";
-
- incidence->recurrence()->dump();
-
- KDateTime dt;
- if (incidence->allDay()) {
- dt = incidence->dtStart().addDays(-1);
- } else {
- dt = incidence->dtStart().addSecs(-1);
- }
- int i = 0;
- if (outstream) {
- // Output to file for testing purposes
- while (dt.isValid() && i < 500) {
- ++i;
- dt = incidence->recurrence()->getNextDateTime(dt);
- if (dt.isValid()) {
- (*outstream) << dumpTime(dt, viewSpec) << endl;
- }
- }
- } else {
- incidence->recurrence()->dump();
- // Output to konsole
- while (dt.isValid() && i<10) {
- ++i;
- qDebug() << "-------------------------------------------";
- dt = incidence->recurrence()->getNextDateTime(dt);
- if (dt.isValid()) {
- qDebug() << " *~*~*~*~ Next date is:" << dumpTime(dt, \
viewSpec);
- }
- }
- }
- }
-
- delete outstream;
- outfile.close();
- return 0;
-}
-
-QString dumpTime(const KDateTime &dt, const KDateTime::Spec &viewSpec)
-{
- if (!dt.isValid()) {
- return QString();
- }
- KDateTime vdt = viewSpec.isValid() ? dt.toTimeSpec(viewSpec) : dt;
- QString format;
-#ifdef FLOAT_IS_DATE_ONLY
- if (vdt.isDateOnly()) {
- format = QStringLiteral("%Y-%m-%d");
- } else
-#endif
- format = QStringLiteral("%Y-%m-%dT%H:%M:%S");
- if (vdt.isSecondOccurrence()) {
- format += QStringLiteral(" %Z");
- }
- if (vdt.timeSpec() != KDateTime::ClockTime) {
- format += QStringLiteral(" %:Z");
- }
- return vdt.toString(format);
-}
diff --git a/kcalcore/tests/testrecurson.cpp \
b/kcalcore/tests/testrecurson.cpp deleted file mode 100644
index 0b1ed2c..0000000
--- a/kcalcore/tests/testrecurson.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
- Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofe.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "memorycalendar.h"
-
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcomponentdata.h>
-#include <qdebug.h>
-
-#include <QDate>
-#include <QtCore/QFile>
-#include <QtCore/QTextStream>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("input", i18n("Name of input file"));
- parser.addPositionalArgument("output", i18n("optional name of output \
file for the recurrence dates"));
-
- KAboutData about(QStringLiteral("testrecurson"),
- i18n("Tests all dates from 2002 to 2010 to test if \
the event recurs on each individual date. "
- "This is meant to test the Recurrence::recursOn \
method for errors."),
- QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testrecurson"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
-
- const QStringList parsedArgs = parser.positionalArguments();
-
- if (parsedArgs.isEmpty()) {
- parser.showHelp();
- }
-
- QString input = parsedArgs[0];
-
- QTextStream *outstream = 0;
- QString fn;
- if (parsedArgs.count() > 1) {
- fn = parsedArgs[1];
-// qDebug() << "We have a file name given:" << fn;
- }
- QFile outfile(fn);
- if (!fn.isEmpty() && outfile.open(QIODevice::WriteOnly)) {
-// qDebug() << "Opened output file!!!";
- outstream = new QTextStream(&outfile);
- }
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
-
- FileStorage store(cal, input);
- if (!store.load()) return 1;
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- cal->setViewTimeZoneId(tz);
- }
-
- Incidence::List inc = cal->incidences();
-
- for (Incidence::List::Iterator it = inc.begin(); it != inc.end(); \
++it) {
- Incidence::Ptr incidence = *it;
-
-// qDebug() << " ->" << incidence->summary() << "<-";
-
-// incidence->recurrence()->dump();
-
- QDate dt(1996, 7, 1);
- if (outstream) {
- // Output to file for testing purposes
- int nr = 0;
- while (dt.year() <= 2020 && nr<=500) {
- if (incidence->recursOn(dt, cal->viewTimeSpec())) {
- (*outstream) << dt.toString(Qt::ISODate) << endl;
- nr++;
- }
- dt = dt.addDays(1);
- }
- } else {
- dt = QDate(2005, 1, 1);
- while (dt.year() < 2007) {
- if (incidence->recursOn(dt, cal->viewTimeSpec())) {
- qDebug() << dt.toString(Qt::ISODate);
- }
- dt = dt.addDays(1);
- }
- }
- }
-
- delete outstream;
- outfile.close();
- return 0;
-}
diff --git a/kcalcore/tests/testvcalexport.cpp \
b/kcalcore/tests/testvcalexport.cpp deleted file mode 100644
index 3aa11dc..0000000
--- a/kcalcore/tests/testvcalexport.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- This file is part of the kcalcore library.
-
- Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
- Copyright (C) 2005 Reinhold Kainhofer <reinhold@kainhofer.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public \
License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "filestorage.h"
-#include "memorycalendar.h"
-#include "vcalformat.h"
-
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kcomponentdata.h>
-#include <qdebug.h>
-#include <klocalizedstring.h>
-
-#include <QtCore/QFile>
-#include <QtCore/QFileInfo>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QCommandLineParser>
-
-using namespace KCalCore;
-
-int main(int argc, char **argv)
-{
- QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "verbose" , \
i18n("Verbose output")));
- parser.addPositionalArgument("input", i18n("Name of input file"));
- parser.addPositionalArgument("output", i18n("Name of output file"));
-
- KAboutData about(QStringLiteral("testvcalexport"),
- i18n("Part of LibKCal's test suite. Checks if export \
"
- "to vCalendar still works correctly."),
- QStringLiteral("0.1"));
-
- about.setupCommandLine(&parser);
- KAboutData::setApplicationData(about);
-
- QCoreApplication app(argc, argv);
- QCoreApplication::setApplicationName(QStringLiteral("testvcalexport"));
- QCoreApplication::setApplicationVersion("0.1");
- parser.process(app);
- about.processCommandLine(&parser);
-
- const QStringList parsedArgs = parser.positionalArguments();
-
- if (parsedArgs.count() != 2) {
- parser.showHelp();
- }
-
- QString input = parsedArgs[0];
- QString output = parsedArgs[1];
-
- QFileInfo outputFileInfo(output);
- output = outputFileInfo.absoluteFilePath();
-
- qDebug() << "Input file:" << input;
- qDebug() << "Output file:" << output;
-
- MemoryCalendar::Ptr cal(new MemoryCalendar(KDateTime::UTC));
- FileStorage instore(cal, input);
-
- if (!instore.load()) {
- return 1;
- }
- QString tz = cal->nonKDECustomProperty("X-LibKCal-Testsuite-OutTZ");
- if (!tz.isEmpty()) {
- cal->setViewTimeZoneId(tz);
- }
-
- FileStorage outstore(cal, output, new VCalFormat);
- if (!outstore.save()) {
- return 1;
- }
-
- return 0;
-}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic