summaryrefslogtreecommitdiff
path: root/libopie/pim/test
Unidiff
Diffstat (limited to 'libopie/pim/test') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/test/oevent_test.cpp23
-rw-r--r--libopie/pim/test/oevent_test.pro11
-rw-r--r--libopie/pim/test/test_todo.cpp36
-rw-r--r--libopie/pim/test/todo_test.pro11
4 files changed, 81 insertions, 0 deletions
diff --git a/libopie/pim/test/oevent_test.cpp b/libopie/pim/test/oevent_test.cpp
new file mode 100644
index 0000000..50cc032
--- a/dev/null
+++ b/libopie/pim/test/oevent_test.cpp
@@ -0,0 +1,23 @@
1#include <qdatetime.h>
2
3#include "../oevent.h"
4
5int main(int argc, char* argv ) {
6 OEvent ev;
7 ev.setUid( 20 );
8
9 ev.setDescription( "Foo" );
10
11 OEvent ev2 = ev;
12 ev2.setDescription("Foo2");
13 qWarning("%s", ev2.description().latin1() );
14 qWarning("%s", ev.description().latin1() );
15
16 QDateTime time = QDateTime::currentDateTime();
17 ev2.setStartDateTime( time );
18 ev2.setTimeZone( "Europe/London" );
19
20 qWarning("%s", ev2.startDateTime().toString().latin1() );
21 qWarning("%s", ev2.startDateTimeInZone().toString().latin1() );
22 return 0;
23}
diff --git a/libopie/pim/test/oevent_test.pro b/libopie/pim/test/oevent_test.pro
new file mode 100644
index 0000000..3365def
--- a/dev/null
+++ b/libopie/pim/test/oevent_test.pro
@@ -0,0 +1,11 @@
1 TEMPLATE= app
2 #CONFIG = qt warn_on debug
3 CONFIG = qt warn_on release
4 #HEADERS =
5 SOURCES = oevent_test.cpp
6 INCLUDEPATH+= $(OPIEDIR)/include
7 DEPENDPATH+= $(OPIEDIR)/include
8LIBS += -lqpe -lopie
9 TARGET = oevent_test
10
11include ( $(OPIEDIR)/include.pro ) \ No newline at end of file
diff --git a/libopie/pim/test/test_todo.cpp b/libopie/pim/test/test_todo.cpp
new file mode 100644
index 0000000..7440503
--- a/dev/null
+++ b/libopie/pim/test/test_todo.cpp
@@ -0,0 +1,36 @@
1#include <qdatetime.h>
2#include <qmap.h>
3
4#include <opie/otodo.h>
5#include <opie/otodoaccess.h>
6#include <opie/otodoaccessxml.h>
7
8int main(int argc, char* argv[] ) {
9
10 OTodoAccessXML* xml = new OTodoAccessXML("demo");
11 OTodoAccess ac(xml);
12 int elc;
13 QTime timer;
14 qWarning("start loading");
15 timer.start();
16 ac.load();
17 elc = timer.elapsed();
18 qWarning("Elapsed loading %d %d", elc, elc/1000);
19
20 timer.start();
21 OTodoAccess::List lis = ac.allRecords();
22 elc = timer.elapsed();
23 qWarning("Elapsed allRecords %d %d", elc, elc/1000 );
24 OTodoAccess::List::Iterator it;
25 timer.start();
26ac.save();
27/*
28 for( it = lis.begin(); it != lis.end(); ++it ) {
29 qWarning("Desc: " + (*it).summary() );
30 qWarning("UID %d", (*it).uid() );
31 }
32 */
33elc = timer.elapsed();
34
35 qWarning("elapsed iterating %d %d", elc, elc/1000 );
36};
diff --git a/libopie/pim/test/todo_test.pro b/libopie/pim/test/todo_test.pro
new file mode 100644
index 0000000..3d14dda
--- a/dev/null
+++ b/libopie/pim/test/todo_test.pro
@@ -0,0 +1,11 @@
1 TEMPLATE= app
2 #CONFIG = qt warn_on debug
3 CONFIG = qt warn_on release
4 #HEADERS =
5 SOURCES = test_todo.cpp
6 INCLUDEPATH+= $(OPIEDIR)/include
7 DEPENDPATH+= $(OPIEDIR)/include
8LIBS += -lqpe -lopie -lopiesql
9 TARGET = todo_test
10
11include ( $(OPIEDIR)/ ) \ No newline at end of file