summaryrefslogtreecommitdiffstats
path: root/libkcal/tests
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkcal/tests
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/tests')
-rw-r--r--libkcal/tests/Makefile.am7
-rw-r--r--libkcal/tests/data/RecurrenceRule/ConnectDaily/ConnectDaily11.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/KAlarm_3.4/KAlarm_TestCase06.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase02.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase24.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase42.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/RFC2445/RFC2445_RRULETestCase12.ics.recurson.ref2
-rw-r--r--libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase02.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase04.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/unsorted/lastworkday.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/unsorted/monthly.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/unsorted/rdate.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/unsorted/test1.ics.recurson.ref1
-rw-r--r--libkcal/tests/data/RecurrenceRule/unsorted/weekly.ics.recurson.ref208
-rwxr-xr-xlibkcal/tests/runtestcase.pl8
-rw-r--r--libkcal/tests/testcalselectdialog.cpp45
16 files changed, 263 insertions, 18 deletions
diff --git a/libkcal/tests/Makefile.am b/libkcal/tests/Makefile.am
index 6e7096a12..1a09143ef 100644
--- a/libkcal/tests/Makefile.am
+++ b/libkcal/tests/Makefile.am
@@ -18,7 +18,8 @@ check_PROGRAMS = testtostring \
testrecurson \
testrecurrencetype \
testvcalexport \
- testfb
+ testfb \
+ testcalselectdialog
METASOURCES = AUTO
@@ -76,6 +77,10 @@ testfb_SOURCES = testfb.cpp
testfb_LDFLAGS = $(all_libraries) $(KDE_RPATH)
testfb_LDADD = ../libkcal.la
+testcalselectdialog_SOURCES = testcalselectdialog.cpp
+testcalselectdialog_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+testcalselectdialog_LDADD = ../libkcal.la
+
TESTFILES = test1.ics test2.ics test3.ics test4.ics test5.ics test_Mozilla.ics
check-local: readandwrite testrecurrence testrecurprevious testrecurson testvcalexport
diff --git a/libkcal/tests/data/RecurrenceRule/ConnectDaily/ConnectDaily11.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/ConnectDaily/ConnectDaily11.ics.recurson.ref
index 1698d7d26..783c984af 100644
--- a/libkcal/tests/data/RecurrenceRule/ConnectDaily/ConnectDaily11.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/ConnectDaily/ConnectDaily11.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-04-01
2005-05-03
2005-05-05
2005-06-07
diff --git a/libkcal/tests/data/RecurrenceRule/KAlarm_3.4/KAlarm_TestCase06.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/KAlarm_3.4/KAlarm_TestCase06.ics.recurson.ref
index 2562eae7c..8b1378917 100644
--- a/libkcal/tests/data/RecurrenceRule/KAlarm_3.4/KAlarm_TestCase06.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/KAlarm_3.4/KAlarm_TestCase06.ics.recurson.ref
@@ -1,2 +1 @@
-2005-05-31
diff --git a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase02.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase02.ics.recurson.ref
index eb9f81585..a17df247a 100644
--- a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase02.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase02.ics.recurson.ref
@@ -1,4 +1,3 @@
-2002-04-02
2002-04-04
2002-04-11
2002-04-18
diff --git a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase24.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase24.ics.recurson.ref
index 7abf1e5ad..13edfa434 100644
--- a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase24.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase24.ics.recurson.ref
@@ -1,4 +1,3 @@
-1997-09-02
1997-09-03
1997-09-05
1997-09-15
diff --git a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase42.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase42.ics.recurson.ref
index 887df0de5..e1d367ade 100644
--- a/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase42.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/LibICal/LibICal_TestCase42.ics.recurson.ref
@@ -1,4 +1,3 @@
-1997-09-02
1998-02-13
1998-03-13
1998-11-13
diff --git a/libkcal/tests/data/RecurrenceRule/RFC2445/RFC2445_RRULETestCase12.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/RFC2445/RFC2445_RRULETestCase12.ics.recurson.ref
index 7abf1e5ad..24ad0551f 100644
--- a/libkcal/tests/data/RecurrenceRule/RFC2445/RFC2445_RRULETestCase12.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/RFC2445/RFC2445_RRULETestCase12.ics.recurson.ref
@@ -1,4 +1,3 @@
-1997-09-02
1997-09-03
1997-09-05
1997-09-15
@@ -23,4 +22,3 @@
1997-12-10
1997-12-12
1997-12-22
-
diff --git a/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase02.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase02.ics.recurson.ref
index 2f3a7e16f..e69de29bb 100644
--- a/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase02.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase02.ics.recurson.ref
@@ -1 +0,0 @@
-1997-12-15
diff --git a/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase04.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase04.ics.recurson.ref
index 6fca0d2fd..f57f89d0e 100644
--- a/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase04.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/UntilInUTC/Until_TestCase04.ics.recurson.ref
@@ -1,2 +1 @@
1997-09-02
-
diff --git a/libkcal/tests/data/RecurrenceRule/unsorted/lastworkday.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/unsorted/lastworkday.ics.recurson.ref
index 05df6b377..c55b5583d 100644
--- a/libkcal/tests/data/RecurrenceRule/unsorted/lastworkday.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/unsorted/lastworkday.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-05-12
2005-05-31
2005-06-30
2005-07-29
diff --git a/libkcal/tests/data/RecurrenceRule/unsorted/monthly.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/unsorted/monthly.ics.recurson.ref
index bbf1358c2..4c2c61aae 100644
--- a/libkcal/tests/data/RecurrenceRule/unsorted/monthly.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/unsorted/monthly.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-05-12
2005-05-18
2005-05-24
2005-06-15
diff --git a/libkcal/tests/data/RecurrenceRule/unsorted/rdate.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/unsorted/rdate.ics.recurson.ref
index 4082c9c20..70712a5e1 100644
--- a/libkcal/tests/data/RecurrenceRule/unsorted/rdate.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/unsorted/rdate.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-05-12
2005-05-14
2005-05-16
2005-05-17
diff --git a/libkcal/tests/data/RecurrenceRule/unsorted/test1.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/unsorted/test1.ics.recurson.ref
index 71cfa3b67..5bd295fc9 100644
--- a/libkcal/tests/data/RecurrenceRule/unsorted/test1.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/unsorted/test1.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-05-12
2007-01-07
2007-01-14
2007-01-21
diff --git a/libkcal/tests/data/RecurrenceRule/unsorted/weekly.ics.recurson.ref b/libkcal/tests/data/RecurrenceRule/unsorted/weekly.ics.recurson.ref
index 59d81cdc1..1b1e01918 100644
--- a/libkcal/tests/data/RecurrenceRule/unsorted/weekly.ics.recurson.ref
+++ b/libkcal/tests/data/RecurrenceRule/unsorted/weekly.ics.recurson.ref
@@ -1,4 +1,3 @@
-2005-05-12
2005-05-23
2005-05-25
2005-06-06
@@ -293,3 +292,210 @@
2010-12-15
2010-12-27
2010-12-29
+2011-01-10
+2011-01-12
+2011-01-24
+2011-01-26
+2011-02-07
+2011-02-09
+2011-02-21
+2011-02-23
+2011-03-07
+2011-03-09
+2011-03-21
+2011-03-23
+2011-04-04
+2011-04-06
+2011-04-18
+2011-04-20
+2011-05-02
+2011-05-04
+2011-05-16
+2011-05-18
+2011-05-30
+2011-06-01
+2011-06-13
+2011-06-15
+2011-06-27
+2011-06-29
+2011-07-11
+2011-07-13
+2011-07-25
+2011-07-27
+2011-08-08
+2011-08-10
+2011-08-22
+2011-08-24
+2011-09-05
+2011-09-07
+2011-09-19
+2011-09-21
+2011-10-03
+2011-10-05
+2011-10-17
+2011-10-19
+2011-10-31
+2011-11-02
+2011-11-14
+2011-11-16
+2011-11-28
+2011-11-30
+2011-12-12
+2011-12-14
+2011-12-26
+2011-12-28
+2012-01-09
+2012-01-11
+2012-01-23
+2012-01-25
+2012-02-06
+2012-02-08
+2012-02-20
+2012-02-22
+2012-03-05
+2012-03-07
+2012-03-19
+2012-03-21
+2012-04-02
+2012-04-04
+2012-04-16
+2012-04-18
+2012-04-30
+2012-05-02
+2012-05-14
+2012-05-16
+2012-05-28
+2012-05-30
+2012-06-11
+2012-06-13
+2012-06-25
+2012-06-27
+2012-07-09
+2012-07-11
+2012-07-23
+2012-07-25
+2012-08-06
+2012-08-08
+2012-08-20
+2012-08-22
+2012-09-03
+2012-09-05
+2012-09-17
+2012-09-19
+2012-10-01
+2012-10-03
+2012-10-15
+2012-10-17
+2012-10-29
+2012-10-31
+2012-11-12
+2012-11-14
+2012-11-26
+2012-11-28
+2012-12-10
+2012-12-12
+2012-12-24
+2012-12-26
+2013-01-07
+2013-01-09
+2013-01-21
+2013-01-23
+2013-02-04
+2013-02-06
+2013-02-18
+2013-02-20
+2013-03-04
+2013-03-06
+2013-03-18
+2013-03-20
+2013-04-01
+2013-04-03
+2013-04-15
+2013-04-17
+2013-04-29
+2013-05-01
+2013-05-13
+2013-05-15
+2013-05-27
+2013-05-29
+2013-06-10
+2013-06-12
+2013-06-24
+2013-06-26
+2013-07-08
+2013-07-10
+2013-07-22
+2013-07-24
+2013-08-05
+2013-08-07
+2013-08-19
+2013-08-21
+2013-09-02
+2013-09-04
+2013-09-16
+2013-09-18
+2013-09-30
+2013-10-02
+2013-10-14
+2013-10-16
+2013-10-28
+2013-10-30
+2013-11-11
+2013-11-13
+2013-11-25
+2013-11-27
+2013-12-09
+2013-12-11
+2013-12-23
+2013-12-25
+2014-01-06
+2014-01-08
+2014-01-20
+2014-01-22
+2014-02-03
+2014-02-05
+2014-02-17
+2014-02-19
+2014-03-03
+2014-03-05
+2014-03-17
+2014-03-19
+2014-03-31
+2014-04-02
+2014-04-14
+2014-04-16
+2014-04-28
+2014-04-30
+2014-05-12
+2014-05-14
+2014-05-26
+2014-05-28
+2014-06-09
+2014-06-11
+2014-06-23
+2014-06-25
+2014-07-07
+2014-07-09
+2014-07-21
+2014-07-23
+2014-08-04
+2014-08-06
+2014-08-18
+2014-08-20
+2014-09-01
+2014-09-03
+2014-09-15
+2014-09-17
+2014-09-29
+2014-10-01
+2014-10-13
+2014-10-15
+2014-10-27
+2014-10-29
+2014-11-10
+2014-11-12
+2014-11-24
+2014-11-26
+2014-12-08
+2014-12-10
+2014-12-22
diff --git a/libkcal/tests/runtestcase.pl b/libkcal/tests/runtestcase.pl
index 52e6ead1e..4cad27cc6 100755
--- a/libkcal/tests/runtestcase.pl
+++ b/libkcal/tests/runtestcase.pl
@@ -78,7 +78,7 @@ sub checkfile()
exit 1;
}
while( <REF> ) {
- push @ref, $_;
+ push @ref, $_ if($_ !~ m/^\s*$/); #skip blank lines in the ref
}
close REF;
@@ -92,10 +92,13 @@ sub checkfile()
$line = 0;
my $errorlines = 0;
while( <READ> ) {
+ next if ($_ =~ m/^\s*$/); #skip blank lines in the output
$out = $_;
$ref = @ref[$i++];
$line++;
+ $out =~ s/\s*$//; #remove trailing whitespace
+ $ref =~ s/\s*$//; #remove trailing whitespace
# DTSTAMP, LAST-MODIFIED and CREATED might be different to the reference...
if ( $out =~ /^DTSTAMP:[0-9ZT]+\r?$/ && $ref =~ /^DTSTAMP:[0-9ZT]+\r?$/ ) {
next;
@@ -122,7 +125,6 @@ sub checkfile()
print " <Remaining error suppressed>\n";
}
}
-
}
close READ;
@@ -150,7 +152,7 @@ sub checkfile()
} else {
print "\n FAILED: $error errors found.\n";
if ( $error > 5 ) {
- system( "diff -u $file.$id.ref $outfile" );
+ system( "diff -u $file.$id.ref $outfile" );
}
system( "touch FAILED" );
exit 1;
diff --git a/libkcal/tests/testcalselectdialog.cpp b/libkcal/tests/testcalselectdialog.cpp
new file mode 100644
index 000000000..5c5130450
--- /dev/null
+++ b/libkcal/tests/testcalselectdialog.cpp
@@ -0,0 +1,45 @@
+/*
+ Copyright (c) 2010 Klar�lvdalens Datakonsult AB, a KDAB Group company <[email protected]>
+
+ 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 "calselectdialog.h"
+using namespace KCal;
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+int main( int argc, char **argv )
+{
+ KCmdLineArgs::init( argc, argv, "testcalselectdialog", 0,
+ "KCalSelectDialogTest", "1.0",
+ "kcalselectedialog test app" );
+ KApplication app;
+ TQStringList cals;
+ cals << "standard" << "shared" << "mine" << "yours";
+ TQString cal = CalSelectDialog::getItem( i18n( "Calendar Selection" ),
+ i18n( "Please select a calendar" ),
+ cals );
+
+ if ( !cal.isEmpty() ) {
+ kdDebug() << "Selected calendar " << cal << endl;
+ } else {
+ kdDebug() << "nothing selected. user cancel" << endl;
+ }
+}