diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kplato/tests | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/tests')
-rw-r--r-- | kplato/tests/CalendarTester.cpp | 40 | ||||
-rw-r--r-- | kplato/tests/DateTimeTester.cpp | 10 |
2 files changed, 25 insertions, 25 deletions
diff --git a/kplato/tests/CalendarTester.cpp b/kplato/tests/CalendarTester.cpp index 1afcce6d..460679ec 100644 --- a/kplato/tests/CalendarTester.cpp +++ b/kplato/tests/CalendarTester.cpp @@ -23,7 +23,7 @@ #include <kptmap.h> #include <kunittest/runner.h> #include <kunittest/module.h> -#include <qstring.h> +#include <tqstring.h> using namespace KUnitTest; @@ -38,15 +38,15 @@ void CalendarTester::allTests() { void CalendarTester::testSingleDay() { KPlato::Calendar t("Test"); - QDate wdate(2006,1,2); + TQDate wdate(2006,1,2); KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-1)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(1)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::DateTime wdt1(wdate, t1); KPlato::DateTime wdt2(wdate, t2); - KPlato::CalendarDay *day = new KPlato::CalendarDay(QDate(2006,1,2), KPlato::Map::Working); - day->addInterval(QPair<QTime, QTime>(t1, t2)); + KPlato::CalendarDay *day = new KPlato::CalendarDay(TQDate(2006,1,2), KPlato::Map::Working); + day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); VERIFY(t.addDay(day)); COMPARE(t.findDay(wdate), day); VERIFY((t.firstAvailableAfter(after, after.addDays(10))).isValid() == false); @@ -68,40 +68,40 @@ void CalendarTester::testSingleDay() { void CalendarTester::testWeekdays() { KPlato::Calendar t("Test"); - QDate wdate(2006,1,4); // wednesday + TQDate wdate(2006,1,4); // wednesday KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-2)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(2)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::CalendarDay *wd1 = t.weekday(2); // wednesday VERIFY(wd1 != 0); wd1->setState(KPlato::Map::Working); - wd1->addInterval(QPair<QTime, QTime>(t1, t2)); + wd1->addInterval(TQPair<TQTime, TQTime>(t1, t2)); - COMPARE(t.firstAvailableAfter(before, after).toString(), QDateTime(QDate(2006, 1, 4), QTime(8,0,0)).toString()); - COMPARE((t.firstAvailableBefore(after, before)).toString(), QDateTime(QDate(2006, 1, 4), QTime(10,0,0)).toString()); + COMPARE(t.firstAvailableAfter(before, after).toString(), TQDateTime(TQDate(2006, 1, 4), TQTime(8,0,0)).toString()); + COMPARE((t.firstAvailableBefore(after, before)).toString(), TQDateTime(TQDate(2006, 1, 4), TQTime(10,0,0)).toString()); - COMPARE(t.firstAvailableAfter(after, KPlato::DateTime(QDate(2006,1,14))).toString(), QDateTime(QDate(2006, 1, 11), QTime(8,0,0)).toString()); - COMPARE(t.firstAvailableBefore(before, KPlato::DateTime(QDate(2005,12,25))).toString(), QDateTime(QDate(2005, 12, 28), QTime(10,0,0)).toString()); + COMPARE(t.firstAvailableAfter(after, KPlato::DateTime(TQDate(2006,1,14))).toString(), TQDateTime(TQDate(2006, 1, 11), TQTime(8,0,0)).toString()); + COMPARE(t.firstAvailableBefore(before, KPlato::DateTime(TQDate(2005,12,25))).toString(), TQDateTime(TQDate(2005, 12, 28), TQTime(10,0,0)).toString()); } void CalendarTester::testCalendarWithParent() { KPlato::Calendar t("Test 3"); - KPlato::Calendar p("Test 3 parent"); + KPlato::Calendar p("Test 3 tqparent"); t.setParent(&p); - QDate wdate(2006,1,2); + TQDate wdate(2006,1,2); KPlato::DateTime before = KPlato::DateTime(wdate.addDays(-1)); KPlato::DateTime after = KPlato::DateTime(wdate.addDays(1)); - QTime t1(8,0,0); - QTime t2(10,0,0); + TQTime t1(8,0,0); + TQTime t2(10,0,0); KPlato::DateTime wdt1(wdate, t1); KPlato::DateTime wdt2(wdate, t2); - KPlato::CalendarDay *day = new KPlato::CalendarDay(QDate(2006,1,2), KPlato::Map::Working); - day->addInterval(QPair<QTime, QTime>(t1, t2)); + KPlato::CalendarDay *day = new KPlato::CalendarDay(TQDate(2006,1,2), KPlato::Map::Working); + day->addInterval(TQPair<TQTime, TQTime>(t1, t2)); COMPARE(p.addDay(day), true); COMPARE(p.findDay(wdate), day); diff --git a/kplato/tests/DateTimeTester.cpp b/kplato/tests/DateTimeTester.cpp index d7bd2fb8..c1c18de9 100644 --- a/kplato/tests/DateTimeTester.cpp +++ b/kplato/tests/DateTimeTester.cpp @@ -22,7 +22,7 @@ #include <kunittest/runner.h> #include <kunittest/module.h> -#include <qdatetime.h> +#include <tqdatetime.h> using namespace KUnitTest; @@ -36,8 +36,8 @@ void DateTimeTester::allTests() { //FIXME: Define a operator<< for Duration void DateTimeTester::testSubtract() { - KPlato::DateTime dt1(QDate(2006, 1, 1), QTime(8, 0, 0)); - KPlato::DateTime dt2(QDate(2006, 1, 1), QTime(10, 0, 0)); + KPlato::DateTime dt1(TQDate(2006, 1, 1), TQTime(8, 0, 0)); + KPlato::DateTime dt2(TQDate(2006, 1, 1), TQTime(10, 0, 0)); KPlato::Duration d(0, 2, 0); COMPARE((dt2-dt1).toString(), d.toString()); @@ -46,8 +46,8 @@ void DateTimeTester::testSubtract() { } void DateTimeTester::testAdd() { - KPlato::DateTime dt1(QDate(2006, 1, 1), QTime(8, 0, 0)); - KPlato::DateTime dt2(QDate(2006, 1, 1), QTime(10, 0, 0)); + KPlato::DateTime dt1(TQDate(2006, 1, 1), TQTime(8, 0, 0)); + KPlato::DateTime dt2(TQDate(2006, 1, 1), TQTime(10, 0, 0)); KPlato::Duration d(0, 2, 0); COMPARE((dt1+d).toString(), dt2.toString()); } |