-rw-r--r-- | libopie/pim/test/oevent_test.cpp | 23 | ||||
-rw-r--r-- | libopie/pim/test/oevent_test.pro | 11 | ||||
-rw-r--r-- | libopie/pim/test/test_todo.cpp | 36 | ||||
-rw-r--r-- | libopie/pim/test/todo_test.pro | 11 |
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 @@ +#include <qdatetime.h> + +#include "../oevent.h" + +int main(int argc, char* argv ) { + OEvent ev; + ev.setUid( 20 ); + + ev.setDescription( "Foo" ); + + OEvent ev2 = ev; + ev2.setDescription("Foo2"); + qWarning("%s", ev2.description().latin1() ); + qWarning("%s", ev.description().latin1() ); + + QDateTime time = QDateTime::currentDateTime(); + ev2.setStartDateTime( time ); + ev2.setTimeZone( "Europe/London" ); + + qWarning("%s", ev2.startDateTime().toString().latin1() ); + qWarning("%s", ev2.startDateTimeInZone().toString().latin1() ); + return 0; +} 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 @@ +TEMPLATE = app +#CONFIG = qt warn_on debug +CONFIG = qt warn_on release +#HEADERS = +SOURCES = oevent_test.cpp +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopie +TARGET = oevent_test + +include ( $(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 @@ +#include <qdatetime.h> +#include <qmap.h> + +#include <opie/otodo.h> +#include <opie/otodoaccess.h> +#include <opie/otodoaccessxml.h> + +int main(int argc, char* argv[] ) { + + OTodoAccessXML* xml = new OTodoAccessXML("demo"); + OTodoAccess ac(xml); + int elc; + QTime timer; + qWarning("start loading"); + timer.start(); + ac.load(); + elc = timer.elapsed(); + qWarning("Elapsed loading %d %d", elc, elc/1000); + + timer.start(); + OTodoAccess::List lis = ac.allRecords(); + elc = timer.elapsed(); + qWarning("Elapsed allRecords %d %d", elc, elc/1000 ); + OTodoAccess::List::Iterator it; + timer.start(); +ac.save(); +/* + for( it = lis.begin(); it != lis.end(); ++it ) { + qWarning("Desc: " + (*it).summary() ); + qWarning("UID %d", (*it).uid() ); + } + */ +elc = timer.elapsed(); + + qWarning("elapsed iterating %d %d", elc, elc/1000 ); +}; 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 @@ +TEMPLATE = app +#CONFIG = qt warn_on debug +CONFIG = qt warn_on release +#HEADERS = +SOURCES = test_todo.cpp +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopie -lopiesql +TARGET = todo_test + +include ( $(OPIEDIR)/ )
\ No newline at end of file |