summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/mymoneyscheduletest.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/mymoney/mymoneyscheduletest.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney/mymoneyscheduletest.cpp')
-rw-r--r--kmymoney2/mymoney/mymoneyscheduletest.cpp522
1 files changed, 261 insertions, 261 deletions
diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp
index 0a4a380..07b3cc6 100644
--- a/kmymoney2/mymoney/mymoneyscheduletest.cpp
+++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp
@@ -55,8 +55,8 @@ void MyMoneyScheduleTest::testConstructor() {
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- QDate::currentDate(),
- QDate(),
+ TQDate::tqcurrentDate(),
+ TQDate(),
true,
true);
@@ -64,7 +64,7 @@ void MyMoneyScheduleTest::testConstructor() {
CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_WEEKLY);
CPPUNIT_ASSERT(s.occurenceMultiplier() == 1 );
CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT);
- CPPUNIT_ASSERT(s.startDate() == QDate());
+ CPPUNIT_ASSERT(s.startDate() == TQDate());
CPPUNIT_ASSERT(s.willEnd() == false);
CPPUNIT_ASSERT(s.isFixed() == true);
CPPUNIT_ASSERT(s.autoEnter() == true);
@@ -82,8 +82,8 @@ void MyMoneyScheduleTest::testSetFunctions() {
s.setType(MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(s.type() == MyMoneySchedule::TYPE_BILL);
- s.setEndDate(QDate::currentDate());
- CPPUNIT_ASSERT(s.endDate() == QDate::currentDate());
+ s.setEndDate(TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(s.endDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(s.willEnd() == true);
}
@@ -151,7 +151,7 @@ void MyMoneyScheduleTest::testAddSchedule()
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- QDate(2001, 1, 1),
+ TQDate(2001, 1, 1),
false,
true,
true);
@@ -160,7 +160,7 @@ void MyMoneyScheduleTest::testAddSchedule()
MyMoneySchedule::TYPE_DEPOSIT,
MyMoneySchedule::OCCUR_MONTHLY, 1,
MyMoneySchedule::STYPE_MANUALDEPOSIT,
- QDate(2001, 2, 1),
+ TQDate(2001, 2, 1),
false,
true,
true);
@@ -168,8 +168,8 @@ void MyMoneyScheduleTest::testAddSchedule()
MyMoneySchedule s3( "s3",
MyMoneySchedule::TYPE_TRANSFER,
MyMoneySchedule::OCCUR_YEARLY, 1,
- MyMoneySchedule::STYPE_WRITECHEQUE,
- QDate(2001, 3, 1),
+ MyMoneySchedule::STYPE_WRITECHETQUE,
+ TQDate(2001, 3, 1),
false,
true,
true);
@@ -216,7 +216,7 @@ void MyMoneyScheduleTest::testAnyScheduled()
MyMoneySchedule::STYPE_MANUALDEPOSIT));
CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_ANY,
MyMoneySchedule::OCCUR_ANY,
- MyMoneySchedule::STYPE_WRITECHEQUE));
+ MyMoneySchedule::STYPE_WRITECHETQUE));
// Failures
CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_BILL,
@@ -229,18 +229,18 @@ void MyMoneyScheduleTest::testOverdue()
MyMoneySchedule sch_overdue;
MyMoneySchedule sch_intime;
- // the following checks only work correctly, if currentDate() is
+ // the following checks only work correctly, if tqcurrentDate() is
// between the 1st and 27th. If it is between 28th and 31st
// we don't perform them. Note: this should be fixed.
- if(QDate::currentDate().day() > 27 || QDate::currentDate().day() == 1) {
+ if(TQDate::tqcurrentDate().day() > 27 || TQDate::tqcurrentDate().day() == 1) {
std::cout << std::endl << "testOverdue() skipped because current day is between 28th and 2nd" << std::endl;
return;
}
- QDate startDate = QDate::currentDate().addDays(-1).addMonths(-23);
- QDate lastPaymentDate = QDate::currentDate().addDays(-1).addMonths(-1);
+ TQDate startDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-23);
+ TQDate lastPaymentDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-1);
- QString ref = QString(
+ TQString ref = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"0\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"8\" endDate=\"\" type=\"5\" id=\"SCH0002\" name=\"A Name\" fixed=\"0\" occurenceMultiplier=\"1\" occurence=\"32\" >\n"
@@ -258,16 +258,16 @@ void MyMoneyScheduleTest::testOverdue()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n");
- QString ref_overdue = ref.arg(startDate.toString(Qt::ISODate))
- .arg(lastPaymentDate.toString(Qt::ISODate))
- .arg(lastPaymentDate.toString(Qt::ISODate));
+ TQString ref_overdue = ref.tqarg(startDate.toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.toString(Qt::ISODate));
- QString ref_intime = ref.arg(startDate.addDays(1).toString(Qt::ISODate))
- .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate))
- .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate));
+ TQString ref_intime = ref.tqarg(startDate.addDays(1).toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate));
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
// std::cout << ref_intime << std::endl;
try {
@@ -318,7 +318,7 @@ void MyMoneyScheduleTest::testGetSchedule()
CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_MONTHLY);
CPPUNIT_ASSERT(s.occurenceMultiplier() == 1);
CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_MANUALDEPOSIT);
- CPPUNIT_ASSERT(s.startDate() == QDate(2001, 2, 1));
+ CPPUNIT_ASSERT(s.startDate() == TQDate(2001, 2, 1));
CPPUNIT_ASSERT(s.willEnd() == false);
CPPUNIT_ASSERT(s.isFixed() == true);
CPPUNIT_ASSERT(s.autoEnter() == true);
@@ -344,7 +344,7 @@ void MyMoneyScheduleTest::testGetScheduled()
try
{
- QValueList<QString> testList;
+ TQValueList<TQString> testList;
testList = m->getScheduled("A000001");
CPPUNIT_ASSERT(testList.size() == 3);
@@ -370,7 +370,7 @@ void MyMoneyScheduleTest::testGetScheduled()
CPPUNIT_ASSERT(testList.size() == 1);
CPPUNIT_ASSERT(testList[0] == "SCHED00002");
- testList = m->getScheduled("A000001", QDate(2001, 1, 1), QDate(2001, 2, 1));
+ testList = m->getScheduled("A000001", TQDate(2001, 1, 1), TQDate(2001, 2, 1));
CPPUNIT_ASSERT(testList.size() == 2);
CPPUNIT_ASSERT(testList[0] == "SCHED00001");
CPPUNIT_ASSERT(testList[1] == "SCHED00002");
@@ -392,7 +392,7 @@ void MyMoneyScheduleTest::testGetOverdue()
try
{
- QValueList<QString> testList;
+ TQValueList<TQString> testList;
testList = m->getOverdue("A000001");
CPPUNIT_ASSERT(testList.size() == 3);
@@ -433,7 +433,7 @@ void MyMoneyScheduleTest::testNextPayment()
*/
{
MyMoneySchedule sch;
- QString future_sched = QString(
+ TQString future_sched = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
"<SCHEDULED_TX startDate=\"2007-02-17\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH000058\" name=\"Car Tax\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"16384\" >\n"
@@ -449,16 +449,16 @@ void MyMoneyScheduleTest::testNextPayment()
"</SCHEDULE-CONTAINER>\n"
);
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
doc.setContent(future_sched);
node = doc.documentElement().firstChild().toElement();
try {
sch = MyMoneySchedule(node);
- CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,14)) == QDate(2007,2,17));
- CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,17)) == QDate(2008,2,17));
- CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,18)) == QDate(2008,2,17));
+ CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,14)) == TQDate(2007,2,17));
+ CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,17)) == TQDate(2008,2,17));
+ CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,18)) == TQDate(2008,2,17));
} catch(MyMoneyException *e) {
delete e;
@@ -474,9 +474,9 @@ void MyMoneyScheduleTest::testNextPayment()
MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002");
MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003");
- QDate nextPayment1 = s1.nextPayment();
- QDate nextPayment2 = s2.nextPayment();
- QDate nextPayment3 = s3.nextPayment();
+ TQDate nextPayment1 = s1.nextPayment();
+ TQDate nextPayment2 = s2.nextPayment();
+ TQDate nextPayment3 = s3.nextPayment();
CPPUNIT_ASSERT(nextPayment1.year() != 1900);
CPPUNIT_ASSERT(nextPayment2.year() != 1900);
@@ -494,148 +494,148 @@ void MyMoneyScheduleTest::testAddHalfMonths()
// addHalfMonths is private
// Test a Schedule with occurence OCCUR_EVERYHALFMONTH using nextPayment
MyMoneySchedule s;
- s.setStartDate(QDate(2007, 1, 1));
+ s.setStartDate(TQDate(2007, 1, 1));
s.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH);
s.setNextDueDate(s.startDate());
s.setLastPayment(s.startDate());
- QString format("yyyy-MM-dd");
+ TQString format("yyyy-MM-dd");
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-16" );
- s.setNextDueDate(QDate(2007, 1, 2));
+ s.setNextDueDate(TQDate(2007, 1, 2));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-17" );
- s.setNextDueDate(QDate(2007, 1, 3));
+ s.setNextDueDate(TQDate(2007, 1, 3));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-18" );
- s.setNextDueDate(QDate(2007, 1, 4));
+ s.setNextDueDate(TQDate(2007, 1, 4));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-19" );
- s.setNextDueDate(QDate(2007, 1, 5));
+ s.setNextDueDate(TQDate(2007, 1, 5));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-20" );
- s.setNextDueDate(QDate(2007, 1, 6));
+ s.setNextDueDate(TQDate(2007, 1, 6));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-21" );
- s.setNextDueDate(QDate(2007, 1, 7));
+ s.setNextDueDate(TQDate(2007, 1, 7));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-22" );
- s.setNextDueDate(QDate(2007, 1, 8));
+ s.setNextDueDate(TQDate(2007, 1, 8));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-23" );
- s.setNextDueDate(QDate(2007, 1, 9));
+ s.setNextDueDate(TQDate(2007, 1, 9));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-24" );
- s.setNextDueDate(QDate(2007, 1, 10));
+ s.setNextDueDate(TQDate(2007, 1, 10));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-25" );
- s.setNextDueDate(QDate(2007, 1, 11));
+ s.setNextDueDate(TQDate(2007, 1, 11));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-26" );
- s.setNextDueDate(QDate(2007, 1, 12));
+ s.setNextDueDate(TQDate(2007, 1, 12));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-27" );
- s.setNextDueDate(QDate(2007, 1, 13));
+ s.setNextDueDate(TQDate(2007, 1, 13));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-28" );
- s.setNextDueDate(QDate(2007, 1, 14));
+ s.setNextDueDate(TQDate(2007, 1, 14));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-29" );
// 15 -> Last Day
- s.setNextDueDate(QDate(2007, 1, 15));
+ s.setNextDueDate(TQDate(2007, 1, 15));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-31" );
- s.setNextDueDate(QDate(2007, 1, 16));
+ s.setNextDueDate(TQDate(2007, 1, 16));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-01" );
- s.setNextDueDate(QDate(2007, 1, 17));
+ s.setNextDueDate(TQDate(2007, 1, 17));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-02" );
- s.setNextDueDate(QDate(2007, 1, 18));
+ s.setNextDueDate(TQDate(2007, 1, 18));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-03" );
- s.setNextDueDate(QDate(2007, 1, 19));
+ s.setNextDueDate(TQDate(2007, 1, 19));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-04" );
- s.setNextDueDate(QDate(2007, 1, 20));
+ s.setNextDueDate(TQDate(2007, 1, 20));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-05" );
- s.setNextDueDate(QDate(2007, 1, 21));
+ s.setNextDueDate(TQDate(2007, 1, 21));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-06" );
- s.setNextDueDate(QDate(2007, 1, 22));
+ s.setNextDueDate(TQDate(2007, 1, 22));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-07" );
- s.setNextDueDate(QDate(2007, 1, 23));
+ s.setNextDueDate(TQDate(2007, 1, 23));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-08" );
- s.setNextDueDate(QDate(2007, 1, 24));
+ s.setNextDueDate(TQDate(2007, 1, 24));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-09" );
- s.setNextDueDate(QDate(2007, 1, 25));
+ s.setNextDueDate(TQDate(2007, 1, 25));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-10" );
- s.setNextDueDate(QDate(2007, 1, 26));
+ s.setNextDueDate(TQDate(2007, 1, 26));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-11" );
- s.setNextDueDate(QDate(2007, 1, 27));
+ s.setNextDueDate(TQDate(2007, 1, 27));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-12" );
- s.setNextDueDate(QDate(2007, 1, 28));
+ s.setNextDueDate(TQDate(2007, 1, 28));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-13" );
- s.setNextDueDate(QDate(2007, 1, 29));
+ s.setNextDueDate(TQDate(2007, 1, 29));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-14" );
// 30th,31st -> 15th
- s.setNextDueDate(QDate(2007, 1, 30));
+ s.setNextDueDate(TQDate(2007, 1, 30));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" );
- s.setNextDueDate(QDate(2007, 1, 31));
+ s.setNextDueDate(TQDate(2007, 1, 31));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" );
// 30th (last day)
- s.setNextDueDate(QDate(2007, 4, 30));
+ s.setNextDueDate(TQDate(2007, 4, 30));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-05-15" );
// 28th of February (Last day): to 15th
- s.setNextDueDate(QDate(1900, 2, 28));
+ s.setNextDueDate(TQDate(1900, 2, 28));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "1900-03-15" );
// 28th of February (Leap year): to 13th
- s.setNextDueDate(QDate(2000, 2, 28));
+ s.setNextDueDate(TQDate(2000, 2, 28));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-13" );
// 29th of February (Leap year)
- s.setNextDueDate(QDate(2000, 2, 29));
+ s.setNextDueDate(TQDate(2000, 2, 29));
CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-15" );
// Add multiple transactions
- s.setStartDate(QDate(2007, 1, 1));
+ s.setStartDate(TQDate(2007, 1, 1));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-16" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-01" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-16" );
- s.setStartDate(QDate(2007, 1, 12));
+ s.setStartDate(TQDate(2007, 1, 12));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-27" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-12" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-27" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-12" );
- s.setStartDate(QDate(2007, 1, 13));
+ s.setStartDate(TQDate(2007, 1, 13));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-28" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-13" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" );
- s.setStartDate(QDate(2007, 1, 14));
+ s.setStartDate(TQDate(2007, 1, 14));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-29" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-14" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" );
- s.setStartDate(QDate(2007, 1, 15));
+ s.setStartDate(TQDate(2007, 1, 15));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-31" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-15" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" );
- s.setStartDate(QDate(2007, 1, 16));
+ s.setStartDate(TQDate(2007, 1, 16));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-01" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-16" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-01" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-16" );
- s.setStartDate(QDate(2007, 1, 27));
+ s.setStartDate(TQDate(2007, 1, 27));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-12" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-27" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-12" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-27" );
- s.setStartDate(QDate(2007, 1, 28));
+ s.setStartDate(TQDate(2007, 1, 28));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-13" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" );
- s.setStartDate(QDate(2007, 1, 29));
+ s.setStartDate(TQDate(2007, 1, 29));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-14" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" );
- s.setStartDate(QDate(2007, 1, 30));
+ s.setStartDate(TQDate(2007, 1, 30));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" );
- s.setStartDate(QDate(2007, 1, 31));
+ s.setStartDate(TQDate(2007, 1, 31));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" );
- s.setStartDate(QDate(2007, 4, 29));
+ s.setStartDate(TQDate(2007, 4, 29));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-14" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-29" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-14" );
CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-06-29" );
- s.setStartDate(QDate(2007, 4, 30));
+ s.setStartDate(TQDate(2007, 4, 30));
CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-15" );
CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-31" );
CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-15" );
@@ -645,7 +645,7 @@ void MyMoneyScheduleTest::testAddHalfMonths()
void MyMoneyScheduleTest::testPaymentDates()
{
MyMoneySchedule sch;
- QString ref_ok = QString(
+ TQString ref_ok = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
@@ -663,23 +663,23 @@ void MyMoneyScheduleTest::testPaymentDates()
"</SCHEDULE-CONTAINER>\n"
);
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
doc.setContent(ref_ok);
node = doc.documentElement().firstChild().toElement();
- QDate startDate(2006,1,28);
- QDate endDate(2006,5,30);
+ TQDate startDate(2006,1,28);
+ TQDate endDate(2006,5,30);
try {
sch = MyMoneySchedule(node);
- QDate nextPayment = sch.nextPayment(startDate);
- QValueList<QDate> list = sch.paymentDates(nextPayment, endDate);
+ TQDate nextPayment = sch.nextPayment(startDate);
+ TQValueList<TQDate> list = sch.paymentDates(nextPayment, endDate);
CPPUNIT_ASSERT(list.count() == 3);
- CPPUNIT_ASSERT(list[0] == QDate(2006,2,28));
- CPPUNIT_ASSERT(list[1] == QDate(2006,3,31));
+ CPPUNIT_ASSERT(list[0] == TQDate(2006,2,28));
+ CPPUNIT_ASSERT(list[1] == TQDate(2006,3,31));
// Would fall on a Sunday so gets moved back to 28th.
- CPPUNIT_ASSERT(list[2] == QDate(2006,4,28));
+ CPPUNIT_ASSERT(list[2] == TQDate(2006,4,28));
// Add tests for each possible occurence.
// Check how paymentDates is meant to work
@@ -692,7 +692,7 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 1);
- CPPUNIT_ASSERT(list[0] == QDate(2009,1,1));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009,1,1));
// MyMoneySchedule::OCCUR_DAILY
sch.setOccurence(MyMoneySchedule::OCCUR_DAILY);
startDate.setYMD(2009,1,1);
@@ -701,20 +701,20 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 1));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 2));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 1));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 2));
// Would fall on Saturday so gets moved to 2nd.
- CPPUNIT_ASSERT(list[2] == QDate(2009, 1, 2));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 1, 2));
// Would fall on Sunday so gets moved to 2nd.
- CPPUNIT_ASSERT(list[3] == QDate(2009, 1, 2));
- CPPUNIT_ASSERT(list[4] == QDate(2009, 1, 5));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009, 1, 2));
+ CPPUNIT_ASSERT(list[4] == TQDate(2009, 1, 5));
// MyMoneySchedule::OCCUR_DAILY with multiplier 2
sch.setOccurenceMultiplier(2);
list = sch.paymentDates(startDate.addDays(1),endDate);
CPPUNIT_ASSERT(list.count() == 2);
// Would fall on Sunday so gets moved to 2nd.
- CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 2));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 5));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 2));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 5));
sch.setOccurenceMultiplier(1);
// MyMoneySchedule::OCCUR_WEEKLY
sch.setOccurence(MyMoneySchedule::OCCUR_WEEKLY);
@@ -724,11 +724,11 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 6));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 1,13));
- CPPUNIT_ASSERT(list[2] == QDate(2009, 1,20));
- CPPUNIT_ASSERT(list[3] == QDate(2009, 1,27));
- CPPUNIT_ASSERT(list[4] == QDate(2009, 2, 3));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 6));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 1,13));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 1,20));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009, 1,27));
+ CPPUNIT_ASSERT(list[4] == TQDate(2009, 2, 3));
// MyMoneySchedule::OCCUR_EVERYOTHERWEEK
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERWEEK);
startDate.setYMD(2009,2,5);
@@ -737,11 +737,11 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009, 2, 5));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 2,19));
- CPPUNIT_ASSERT(list[2] == QDate(2009, 3, 5));
- CPPUNIT_ASSERT(list[3] == QDate(2009, 3,19));
- CPPUNIT_ASSERT(list[4] == QDate(2009, 4, 2));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 2, 5));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 2,19));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 3, 5));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009, 3,19));
+ CPPUNIT_ASSERT(list[4] == TQDate(2009, 4, 2));
// MyMoneySchedule::OCCUR_FORTNIGHTLY
sch.setOccurence(MyMoneySchedule::OCCUR_FORTNIGHTLY);
startDate.setYMD(2009,4,4);
@@ -753,13 +753,13 @@ void MyMoneyScheduleTest::testPaymentDates()
// First one would fall on a Saturday and would get moved
// to 3rd which is before start date so is not in list.
// Would fall on a Saturday so gets moved to 17th.
- CPPUNIT_ASSERT(list[0] == QDate(2009, 4,17));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 4,17));
// Would fall on a Saturday so gets moved to 1st.
- CPPUNIT_ASSERT(list[1] == QDate(2009, 5, 1));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 5, 1));
// Would fall on a Saturday so gets moved to 15th.
- CPPUNIT_ASSERT(list[2] == QDate(2009, 5,15));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 5,15));
// Would fall on a Saturday so gets moved to 29th.
- CPPUNIT_ASSERT(list[3] == QDate(2009, 5,29));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009, 5,29));
// MyMoneySchedule::OCCUR_EVERYHALFMONTH
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH);
startDate.setYMD(2009,6,1);
@@ -768,12 +768,12 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009, 6, 1));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 6,16));
- CPPUNIT_ASSERT(list[2] == QDate(2009, 7, 1));
- CPPUNIT_ASSERT(list[3] == QDate(2009, 7,16));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 6, 1));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 6,16));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 7, 1));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009, 7,16));
// Would fall on a Saturday so gets moved to 31st.
- CPPUNIT_ASSERT(list[4] == QDate(2009, 7, 31));
+ CPPUNIT_ASSERT(list[4] == TQDate(2009, 7, 31));
// MyMoneySchedule::OCCUR_EVERYTHREEWEEKS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS);
startDate.setYMD(2009,8,12);
@@ -782,11 +782,11 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009, 8,12));
- CPPUNIT_ASSERT(list[1] == QDate(2009, 9, 2));
- CPPUNIT_ASSERT(list[2] == QDate(2009, 9,23));
- CPPUNIT_ASSERT(list[3] == QDate(2009,10,14));
- CPPUNIT_ASSERT(list[4] == QDate(2009,11, 4));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009, 8,12));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009, 9, 2));
+ CPPUNIT_ASSERT(list[2] == TQDate(2009, 9,23));
+ CPPUNIT_ASSERT(list[3] == TQDate(2009,10,14));
+ CPPUNIT_ASSERT(list[4] == TQDate(2009,11, 4));
// MyMoneySchedule::OCCUR_EVERYFOURWEEKS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURWEEKS);
startDate.setYMD(2009,11,13);
@@ -795,11 +795,11 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2009,11,13));
- CPPUNIT_ASSERT(list[1] == QDate(2009,12,11));
- CPPUNIT_ASSERT(list[2] == QDate(2010, 1, 8));
- CPPUNIT_ASSERT(list[3] == QDate(2010, 2, 5));
- CPPUNIT_ASSERT(list[4] == QDate(2010, 3, 5));
+ CPPUNIT_ASSERT(list[0] == TQDate(2009,11,13));
+ CPPUNIT_ASSERT(list[1] == TQDate(2009,12,11));
+ CPPUNIT_ASSERT(list[2] == TQDate(2010, 1, 8));
+ CPPUNIT_ASSERT(list[3] == TQDate(2010, 2, 5));
+ CPPUNIT_ASSERT(list[4] == TQDate(2010, 3, 5));
// MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS);
startDate.setYMD(2010,3,19);
@@ -808,13 +808,13 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2010, 3,19));
+ CPPUNIT_ASSERT(list[0] == TQDate(2010, 3,19));
// Would fall on a Sunday so gets moved to 16th.
- CPPUNIT_ASSERT(list[1] == QDate(2010, 4,16));
- CPPUNIT_ASSERT(list[2] == QDate(2010, 5,18));
- CPPUNIT_ASSERT(list[3] == QDate(2010, 6,17));
+ CPPUNIT_ASSERT(list[1] == TQDate(2010, 4,16));
+ CPPUNIT_ASSERT(list[2] == TQDate(2010, 5,18));
+ CPPUNIT_ASSERT(list[3] == TQDate(2010, 6,17));
// Would fall on a Saturday so gets moved to 16th.
- CPPUNIT_ASSERT(list[4] == QDate(2010, 7,16));
+ CPPUNIT_ASSERT(list[4] == TQDate(2010, 7,16));
// MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS);
startDate.setYMD(2010,7,26);
@@ -823,11 +823,11 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2010, 7,26));
- CPPUNIT_ASSERT(list[1] == QDate(2010, 9,20));
- CPPUNIT_ASSERT(list[2] == QDate(2010,11,15));
- CPPUNIT_ASSERT(list[3] == QDate(2011, 1,10));
- CPPUNIT_ASSERT(list[4] == QDate(2011, 3, 7));
+ CPPUNIT_ASSERT(list[0] == TQDate(2010, 7,26));
+ CPPUNIT_ASSERT(list[1] == TQDate(2010, 9,20));
+ CPPUNIT_ASSERT(list[2] == TQDate(2010,11,15));
+ CPPUNIT_ASSERT(list[3] == TQDate(2011, 1,10));
+ CPPUNIT_ASSERT(list[4] == TQDate(2011, 3, 7));
// MyMoneySchedule::OCCUR_EVERYOTHERMONTH
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH);
startDate.setYMD(2011,3,14);
@@ -836,12 +836,12 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2011, 3,14));
+ CPPUNIT_ASSERT(list[0] == TQDate(2011, 3,14));
// Would fall on a Saturday so gets moved to 13th.
- CPPUNIT_ASSERT(list[1] == QDate(2011, 5,13));
- CPPUNIT_ASSERT(list[2] == QDate(2011, 7,14));
- CPPUNIT_ASSERT(list[3] == QDate(2011, 9,14));
- CPPUNIT_ASSERT(list[4] == QDate(2011,11,14));
+ CPPUNIT_ASSERT(list[1] == TQDate(2011, 5,13));
+ CPPUNIT_ASSERT(list[2] == TQDate(2011, 7,14));
+ CPPUNIT_ASSERT(list[3] == TQDate(2011, 9,14));
+ CPPUNIT_ASSERT(list[4] == TQDate(2011,11,14));
// MyMoneySchedule::OCCUR_EVERYTHREEMONTHS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS);
startDate.setYMD(2011,11,15);
@@ -850,24 +850,24 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2011,11,15));
- CPPUNIT_ASSERT(list[1] == QDate(2012, 2,15));
- CPPUNIT_ASSERT(list[2] == QDate(2012, 5,15));
- CPPUNIT_ASSERT(list[3] == QDate(2012, 8,15));
- CPPUNIT_ASSERT(list[4] == QDate(2012,11,15));
- // MyMoneySchedule::OCCUR_QUARTERLY
- sch.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY);
+ CPPUNIT_ASSERT(list[0] == TQDate(2011,11,15));
+ CPPUNIT_ASSERT(list[1] == TQDate(2012, 2,15));
+ CPPUNIT_ASSERT(list[2] == TQDate(2012, 5,15));
+ CPPUNIT_ASSERT(list[3] == TQDate(2012, 8,15));
+ CPPUNIT_ASSERT(list[4] == TQDate(2012,11,15));
+ // MyMoneySchedule::OCCUR_TQUARTERLY
+ sch.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY);
startDate.setYMD(2012,11,20);
endDate.setYMD(2013,11,23);
sch.setStartDate(startDate);
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2012,11,20));
- CPPUNIT_ASSERT(list[1] == QDate(2013, 2,20));
- CPPUNIT_ASSERT(list[2] == QDate(2013, 5,20));
- CPPUNIT_ASSERT(list[3] == QDate(2013, 8,20));
- CPPUNIT_ASSERT(list[4] == QDate(2013,11,20));
+ CPPUNIT_ASSERT(list[0] == TQDate(2012,11,20));
+ CPPUNIT_ASSERT(list[1] == TQDate(2013, 2,20));
+ CPPUNIT_ASSERT(list[2] == TQDate(2013, 5,20));
+ CPPUNIT_ASSERT(list[3] == TQDate(2013, 8,20));
+ CPPUNIT_ASSERT(list[4] == TQDate(2013,11,20));
// MyMoneySchedule::OCCUR_EVERYFOURMONTHS
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS);
startDate.setYMD(2013,11,21);
@@ -876,12 +876,12 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2013,11,21));
- CPPUNIT_ASSERT(list[1] == QDate(2014, 3,21));
- CPPUNIT_ASSERT(list[2] == QDate(2014, 7,21));
- CPPUNIT_ASSERT(list[3] == QDate(2014,11,21));
+ CPPUNIT_ASSERT(list[0] == TQDate(2013,11,21));
+ CPPUNIT_ASSERT(list[1] == TQDate(2014, 3,21));
+ CPPUNIT_ASSERT(list[2] == TQDate(2014, 7,21));
+ CPPUNIT_ASSERT(list[3] == TQDate(2014,11,21));
// Would fall on a Saturday so gets moved to 20th.
- CPPUNIT_ASSERT(list[4] == QDate(2015, 3,20));
+ CPPUNIT_ASSERT(list[4] == TQDate(2015, 3,20));
// MyMoneySchedule::OCCUR_TWICEYEARLY
sch.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY);
startDate.setYMD(2015, 3,22);
@@ -892,10 +892,10 @@ void MyMoneyScheduleTest::testPaymentDates()
CPPUNIT_ASSERT(list.count() == 4);
// First date would fall on a Sunday which would get moved
// to 20th which is before start date so not in list.
- CPPUNIT_ASSERT(list[0] == QDate(2015, 9,22));
- CPPUNIT_ASSERT(list[1] == QDate(2016, 3,22));
- CPPUNIT_ASSERT(list[2] == QDate(2016, 9,22));
- CPPUNIT_ASSERT(list[3] == QDate(2017, 3,22));
+ CPPUNIT_ASSERT(list[0] == TQDate(2015, 9,22));
+ CPPUNIT_ASSERT(list[1] == TQDate(2016, 3,22));
+ CPPUNIT_ASSERT(list[2] == TQDate(2016, 9,22));
+ CPPUNIT_ASSERT(list[3] == TQDate(2017, 3,22));
// MyMoneySchedule::OCCUR_YEARLY
sch.setOccurence(MyMoneySchedule::OCCUR_YEARLY);
startDate.setYMD(2017, 3,23);
@@ -904,12 +904,12 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2017, 3,23));
- CPPUNIT_ASSERT(list[1] == QDate(2018, 3,23));
+ CPPUNIT_ASSERT(list[0] == TQDate(2017, 3,23));
+ CPPUNIT_ASSERT(list[1] == TQDate(2018, 3,23));
// Would fall on a Saturday so gets moved to 22nd.
- CPPUNIT_ASSERT(list[2] == QDate(2019, 3,22));
- CPPUNIT_ASSERT(list[3] == QDate(2020, 3,23));
- CPPUNIT_ASSERT(list[4] == QDate(2021, 3,23));
+ CPPUNIT_ASSERT(list[2] == TQDate(2019, 3,22));
+ CPPUNIT_ASSERT(list[3] == TQDate(2020, 3,23));
+ CPPUNIT_ASSERT(list[4] == TQDate(2021, 3,23));
// MyMoneySchedule::OCCUR_EVERYOTHERYEAR
sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERYEAR);
startDate.setYMD(2021, 3,24);
@@ -918,12 +918,12 @@ void MyMoneyScheduleTest::testPaymentDates()
sch.setNextDueDate(startDate);
list = sch.paymentDates(startDate,endDate);
CPPUNIT_ASSERT(list.count() == 5);
- CPPUNIT_ASSERT(list[0] == QDate(2021, 3,24));
- CPPUNIT_ASSERT(list[1] == QDate(2023, 3,24));
- CPPUNIT_ASSERT(list[2] == QDate(2025, 3,24));
- CPPUNIT_ASSERT(list[3] == QDate(2027, 3,24));
+ CPPUNIT_ASSERT(list[0] == TQDate(2021, 3,24));
+ CPPUNIT_ASSERT(list[1] == TQDate(2023, 3,24));
+ CPPUNIT_ASSERT(list[2] == TQDate(2025, 3,24));
+ CPPUNIT_ASSERT(list[3] == TQDate(2027, 3,24));
// Would fall on a Saturday so gets moved to 23rd.
- CPPUNIT_ASSERT(list[4] == QDate(2029, 3,23));
+ CPPUNIT_ASSERT(list[4] == TQDate(2029, 3,23));
} catch(MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
@@ -938,9 +938,9 @@ void MyMoneyScheduleTest::testPaymentDates()
MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002");
MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003");
- QValueList<QDate> payments1 = s1.paymentDates(QDate(2001, 1, 1), QDate(2001, 2, 1));
- QValueList<QDate> payments2 = s2.paymentDates(QDate(2001, 2, 1), QDate(2001, 6, 1));
- QValueList<QDate> payments3 = s3.paymentDates(QDate(2001, 3, 1), QDate(2005, 3, 1));
+ TQValueList<TQDate> payments1 = s1.paymentDates(TQDate(2001, 1, 1), TQDate(2001, 2, 1));
+ TQValueList<TQDate> payments2 = s2.paymentDates(TQDate(2001, 2, 1), TQDate(2001, 6, 1));
+ TQValueList<TQDate> payments3 = s3.paymentDates(TQDate(2001, 3, 1), TQDate(2005, 3, 1));
CPPUNIT_ASSERT(payments1.size() == 5);
CPPUNIT_ASSERT(payments2.size() == 5);
@@ -985,7 +985,7 @@ void MyMoneyScheduleTest::testRemoveSchedule()
try
{
- QValueList<QString> testList;
+ TQValueList<TQString> testList;
testList = m->getScheduled("A000001");
CPPUNIT_ASSERT(testList.size() == 3);
@@ -1010,18 +1010,18 @@ void MyMoneyScheduleTest::testWriteXML() {
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 123,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- QDate::currentDate(),
- QDate(),
+ TQDate::tqcurrentDate(),
+ TQDate(),
true,
true);
- sch.setLastPayment(QDate::currentDate());
- sch.recordPayment(QDate::currentDate());
+ sch.setLastPayment(TQDate::tqcurrentDate());
+ sch.recordPayment(TQDate::tqcurrentDate());
sch.setId("SCH0001");
MyMoneyTransaction t;
- t.setPostDate(QDate(2001,12,28));
- t.setEntryDate(QDate(2003,9,29));
+ t.setPostDate(TQDate(2001,12,28));
+ t.setEntryDate(TQDate(2003,9,29));
t.setId("T000000000000000001");
t.setMemo("Wohnung:Miete");
t.setCommodity("EUR");
@@ -1047,12 +1047,12 @@ void MyMoneyScheduleTest::testWriteXML() {
sch.setTransaction(t);
- QDomDocument doc("TEST");
- QDomElement el = doc.createElement("SCHEDULE-CONTAINER");
+ TQDomDocument doc("TEST");
+ TQDomElement el = doc.createElement("SCHEDULE-CONTAINER");
doc.appendChild(el);
sch.writeXML(doc, el);
- QString ref = QString(
+ TQString ref = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0001\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"123\" occurence=\"4\" >\n"
@@ -1070,9 +1070,9 @@ void MyMoneyScheduleTest::testWriteXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
CPPUNIT_ASSERT(doc.toString() == ref);
}
@@ -1080,7 +1080,7 @@ void MyMoneyScheduleTest::testWriteXML() {
void MyMoneyScheduleTest::testReadXML() {
MyMoneySchedule sch;
- QString ref_ok1 = QString(
+ TQString ref_ok1 = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n"
@@ -1098,13 +1098,13 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
// diff to ref_ok1 is that we now have an empty entrydate
// in the transaction parameters
- QString ref_ok2 = QString(
+ TQString ref_ok2 = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n"
@@ -1122,11 +1122,11 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
- QString ref_false = QString(
+ TQString ref_false = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULE startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n"
@@ -1144,12 +1144,12 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
doc.setContent(ref_false);
node = doc.documentElement().firstChild().toElement();
@@ -1167,13 +1167,13 @@ void MyMoneyScheduleTest::testReadXML() {
try {
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.id() == "SCH0002");
- CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7));
- CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate());
- CPPUNIT_ASSERT(sch.endDate() == QDate());
+ CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7));
+ CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(sch.endDate() == TQDate());
CPPUNIT_ASSERT(sch.autoEnter() == true);
CPPUNIT_ASSERT(sch.isFixed() == true);
CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing);
- CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate());
+ CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT);
CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(sch.name() == "A Name");
@@ -1181,7 +1181,7 @@ void MyMoneyScheduleTest::testReadXML() {
CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1);
CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7));
CPPUNIT_ASSERT(sch.recordedPayments().count() == 1);
- CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate());
+ CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
@@ -1194,13 +1194,13 @@ void MyMoneyScheduleTest::testReadXML() {
try {
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.id() == "SCH0002");
- CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7));
- CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate());
- CPPUNIT_ASSERT(sch.endDate() == QDate());
+ CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7));
+ CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(sch.endDate() == TQDate());
CPPUNIT_ASSERT(sch.autoEnter() == true);
CPPUNIT_ASSERT(sch.isFixed() == true);
CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing);
- CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate());
+ CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT);
CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(sch.name() == "A Name");
@@ -1208,7 +1208,7 @@ void MyMoneyScheduleTest::testReadXML() {
CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1);
CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7));
CPPUNIT_ASSERT(sch.recordedPayments().count() == 1);
- CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate());
+ CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
@@ -1218,7 +1218,7 @@ void MyMoneyScheduleTest::testReadXML() {
void MyMoneyScheduleTest::testHasReferenceTo()
{
MyMoneySchedule sch;
- QString ref_ok = QString(
+ TQString ref_ok = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n"
@@ -1236,12 +1236,12 @@ void MyMoneyScheduleTest::testHasReferenceTo()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate))
- .arg(QDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
doc.setContent(ref_ok);
node = doc.documentElement().firstChild().toElement();
@@ -1263,7 +1263,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate()
{
MyMoneySchedule s;
- QDate dueDate(2007,9,3); // start on a monday
+ TQDate dueDate(2007,9,3); // start on a monday
for(int i = 0; i < 7; ++i) {
s.setNextDueDate(dueDate);
s.setWeekendOption(MyMoneySchedule::MoveNothing);
@@ -1274,7 +1274,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate()
case 5: // saturday
case 6: // sunday
break;
- CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,7));
+ CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,7));
default:
CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate);
break;
@@ -1284,7 +1284,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate()
switch(i) {
case 5: // saturday
case 6: // sunday
- CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,10));
+ CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,10));
break;
default:
CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate);
@@ -1297,30 +1297,30 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate()
void MyMoneyScheduleTest::testModifyNextDueDate(void)
{
MyMoneySchedule s;
- s.setStartDate(QDate(2007, 1, 1));
+ s.setStartDate(TQDate(2007, 1, 1));
s.setOccurence(MyMoneySchedule::OCCUR_MONTHLY);
s.setNextDueDate(s.startDate().addMonths(1));
s.setLastPayment(s.startDate());
- QValueList<QDate> dates;
- dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1));
- CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,2,1));
+ TQValueList<TQDate> dates;
+ dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1));
+ CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,2,1));
CPPUNIT_ASSERT(dates.count() == 1);
- CPPUNIT_ASSERT(dates[0] == QDate(2007,2,1));
+ CPPUNIT_ASSERT(dates[0] == TQDate(2007,2,1));
- s.setNextDueDate(QDate(2007,1,24));
+ s.setNextDueDate(TQDate(2007,1,24));
- dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1));
- CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,1,24));
+ dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1));
+ CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,1,24));
CPPUNIT_ASSERT(dates.count() == 0);
- dates = s.paymentDates(QDate(2007,1,24), QDate(2007,1,24));
+ dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,1,24));
CPPUNIT_ASSERT(dates.count() == 1);
- dates = s.paymentDates(QDate(2007,1,24), QDate(2007,2,24));
+ dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,2,24));
CPPUNIT_ASSERT(dates.count() == 2);
- CPPUNIT_ASSERT(dates[0] == QDate(2007,1,24));
- CPPUNIT_ASSERT(dates[1] == QDate(2007,2,24));
+ CPPUNIT_ASSERT(dates[0] == TQDate(2007,1,24));
+ CPPUNIT_ASSERT(dates[1] == TQDate(2007,2,24));
}
@@ -1339,7 +1339,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents()
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 56);
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 60);
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 90);
- CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_QUARTERLY) == 90);
+ CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TQUARTERLY) == 90);
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 120);
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TWICEYEARLY) == 180);
CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_YEARLY) == 360);
@@ -1349,7 +1349,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents()
void MyMoneyScheduleTest::testStringToOccurence()
{
// For each occurenceE:
- // test MyMoneySchedule::stringToOccurence(QString) == occurence
+ // test MyMoneySchedule::stringToOccurence(TQString) == occurence
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Once")) == MyMoneySchedule::OCCUR_ONCE );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Daily")) == MyMoneySchedule::OCCUR_DAILY );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Weekly")) == MyMoneySchedule::OCCUR_WEEKLY );
@@ -1361,7 +1361,7 @@ void MyMoneyScheduleTest::testStringToOccurence()
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every eight weeks")) == MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every two months")) == MyMoneySchedule::OCCUR_EVERYOTHERMONTH );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every three months")) == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS );
- CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_QUARTERLY );
+ CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_TQUARTERLY );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every four months")) == MyMoneySchedule::OCCUR_EVERYFOURMONTHS );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Twice yearly")) == MyMoneySchedule::OCCUR_TWICEYEARLY );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY );
@@ -1382,7 +1382,7 @@ void MyMoneyScheduleTest::testStringToOccurence()
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TQUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY))) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))) );
@@ -1403,7 +1403,7 @@ void MyMoneyScheduleTest::testEventsPerYear()
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 6);
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 6);
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 4);
- CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_QUARTERLY) == 4);
+ CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TQUARTERLY) == 4);
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 3);
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TWICEYEARLY) == 2);
CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_YEARLY) == 1);
@@ -1426,14 +1426,14 @@ void MyMoneyScheduleTest::testOccurenceToString()
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Every eight weeks" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Every two months" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Every three months" );
- CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Quarterly" );
+ CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Quarterly" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Every four months" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Twice yearly" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == "Yearly" );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Every other year" );
// For each occurenceE set occurence and compare occurenceToString() with oTS(occurence())
MyMoneySchedule s;
- s.setStartDate(QDate(2007, 1, 1));
+ s.setStartDate(TQDate(2007, 1, 1));
s.setNextDueDate(s.startDate());
s.setLastPayment(s.startDate());
s.setOccurence(MyMoneySchedule::OCCUR_ONCE); CPPUNIT_ASSERT(s.occurenceToString() == "Once" );
@@ -1451,7 +1451,7 @@ void MyMoneyScheduleTest::testOccurenceToString()
s.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH); CPPUNIT_ASSERT(s.occurenceToString() == "Every two months" );
s.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" );
// Quarterly no longer used. Every three months used instead
- s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" );
+ s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" );
s.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every four months" );
s.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Twice yearly" );
s.setOccurence(MyMoneySchedule::OCCUR_YEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Yearly" );
@@ -1471,7 +1471,7 @@ void MyMoneyScheduleTest::testOccurenceToString()
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == MyMoneySchedule::occurenceToString(8,MyMoneySchedule::OCCUR_WEEKLY) );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == MyMoneySchedule::occurenceToString(2,MyMoneySchedule::OCCUR_MONTHLY) );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == MyMoneySchedule::occurenceToString(3,MyMoneySchedule::OCCUR_MONTHLY) );
- // OCCUR_QUARTERLY will no longer be used: only Every Three Months
+ // OCCUR_TQUARTERLY will no longer be used: only Every Three Months
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == MyMoneySchedule::occurenceToString(4,MyMoneySchedule::OCCUR_MONTHLY) );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == MyMoneySchedule::occurenceToString(6,MyMoneySchedule::OCCUR_MONTHLY) );
CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == MyMoneySchedule::occurenceToString(1,MyMoneySchedule::OCCUR_YEARLY) );
@@ -1545,7 +1545,7 @@ void MyMoneyScheduleTest::testOccurencePeriodToString()
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Any" );
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Any" );
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Any" );
- CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Any" );
+ CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Any" );
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Any" );
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Any" );
CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Any" );
@@ -1561,7 +1561,7 @@ void MyMoneyScheduleTest::testOccurencePeriod()
// Once occurence() and setOccurence() are converting between compound and simple occurences
// we need to change the occurence() check and add an occurenceMultiplier() check
MyMoneySchedule s;
- s.setStartDate(QDate(2007, 1, 1));
+ s.setStartDate(TQDate(2007, 1, 1));
s.setNextDueDate(s.startDate());
s.setLastPayment(s.startDate());
// Set all base occurences
@@ -1730,7 +1730,7 @@ void MyMoneyScheduleTest::testOccurencePeriod()
CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY);
CPPUNIT_ASSERT(s.occurenceMultiplier() == 3);
// Quarterly no longer used. Every three months used instead
- s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY);
+ s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY);
CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS);
CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY);
CPPUNIT_ASSERT(s.occurenceMultiplier() == 3);
@@ -1798,7 +1798,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence()
occ = MyMoneySchedule::OCCUR_EVERYTHREEMONTHS; mult = 1;
MyMoneySchedule::simpleToCompoundOccurence(mult, occ);
CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 );
- occ = MyMoneySchedule::OCCUR_QUARTERLY; mult = 1;
+ occ = MyMoneySchedule::OCCUR_TQUARTERLY; mult = 1;
MyMoneySchedule::simpleToCompoundOccurence(mult, occ);
CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 );
occ = MyMoneySchedule::OCCUR_EVERYFOURMONTHS; mult = 1;
@@ -1851,7 +1851,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence()
occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 3;
MyMoneySchedule::compoundToSimpleOccurence(mult, occ);
CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS && mult == 1 );
- // MyMoneySchedule::OCCUR_QUARTERLY not converted back
+ // MyMoneySchedule::OCCUR_TQUARTERLY not converted back
occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 4;
MyMoneySchedule::compoundToSimpleOccurence(mult, occ);
CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYFOURMONTHS && mult == 1 );
@@ -1872,9 +1872,9 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
// https://bugs.kde.org/show_bug.cgi?id=231029
MyMoneySchedule sch;
- QDate paymentInFuture = QDate::currentDate().addDays(7);
+ TQDate paymentInFuture = TQDate::tqcurrentDate().addDays(7);
- QString ref_ok = QString(
+ TQString ref_ok = TQString(
"<!DOCTYPE TEST>\n"
"<SCHEDULE-CONTAINER>\n"
" <SCHEDULED_TX startDate=\"%1\" autoEnter=\"0\" weekendOption=\"1\" lastPayment=\"%2\" paymentType=\"2\" endDate=\"%3\" type=\"4\" id=\"SCH0042\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"32\" >\n"
@@ -1887,12 +1887,12 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(paymentInFuture.toString(Qt::ISODate))
- .arg(paymentInFuture.toString(Qt::ISODate))
- .arg(paymentInFuture.toString(Qt::ISODate));
+ ).tqarg(paymentInFuture.toString(Qt::ISODate))
+ .tqarg(paymentInFuture.toString(Qt::ISODate))
+ .tqarg(paymentInFuture.toString(Qt::ISODate));
- QDomDocument doc;
- QDomElement node;
+ TQDomDocument doc;
+ TQDomElement node;
doc.setContent(ref_ok);
node = doc.documentElement().firstChild().toElement();
@@ -1900,7 +1900,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.isFinished() == true);
CPPUNIT_ASSERT(sch.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY);
- CPPUNIT_ASSERT(sch.paymentDates(QDate::currentDate(), QDate::currentDate().addDays(21)).count() == 0);
+ CPPUNIT_ASSERT(sch.paymentDates(TQDate::tqcurrentDate(), TQDate::tqcurrentDate().addDays(21)).count() == 0);
} catch (MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");