diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/mymoney/mymoneyaccounttest.cpp | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-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/mymoneyaccounttest.cpp')
-rw-r--r-- | kmymoney2/mymoney/mymoneyaccounttest.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/kmymoney2/mymoney/mymoneyaccounttest.cpp b/kmymoney2/mymoney/mymoneyaccounttest.cpp index 1384c5c..0e1fbbf 100644 --- a/kmymoney2/mymoney/mymoneyaccounttest.cpp +++ b/kmymoney2/mymoney/mymoneyaccounttest.cpp @@ -35,26 +35,26 @@ void MyMoneyAccountTest::testEmptyConstructor() { CPPUNIT_ASSERT(a.id().isEmpty()); CPPUNIT_ASSERT(a.name().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::UnknownAccountType); - CPPUNIT_ASSERT(a.openingDate() == QDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); - CPPUNIT_ASSERT(a.lastReconciliationDate() == QDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); + CPPUNIT_ASSERT(a.lastReconciliationDate() == TQDate()); CPPUNIT_ASSERT(a.accountList().count() == 0); CPPUNIT_ASSERT(a.balance().isZero()); } void MyMoneyAccountTest::testConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; MyMoneySplit s; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setNumber("465500"); - r.setParentAccountId(parent); - r.setValue(QString("key"), "value"); + r.setParentAccountId(tqparent); + r.setValue(TQString("key"), "value"); s.setShares(MyMoneyMoney(1,1)); r.adjustBalance(s); CPPUNIT_ASSERT(r.m_kvp.count() == 1); @@ -65,26 +65,26 @@ void MyMoneyAccountTest::testConstructor() { CPPUNIT_ASSERT(a.id() == id); CPPUNIT_ASSERT(a.institutionId().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::Asset); - CPPUNIT_ASSERT(a.openingDate() == QDate::currentDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.number() == "465500"); CPPUNIT_ASSERT(a.description() == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 0); - CPPUNIT_ASSERT(a.parentAccountId() == "Parent"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "Parent"); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(1,1)); - QMap<QString, QString> copy; + TQMap<TQString, TQString> copy; copy = r.pairs(); CPPUNIT_ASSERT(copy.count() == 1); - CPPUNIT_ASSERT(copy[QString("key")] == "value"); + CPPUNIT_ASSERT(copy[TQString("key")] == "value"); } void MyMoneyAccountTest::testSetFunctions() { MyMoneyAccount a; - QDate today(QDate::currentDate()); + TQDate today(TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.name().isEmpty()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); CPPUNIT_ASSERT(a.description().isEmpty()); a.setName("Account"); @@ -103,18 +103,18 @@ void MyMoneyAccountTest::testSetFunctions() { } void MyMoneyAccountTest::testCopyConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "ParentAccount"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "ParentAccount"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Expense); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setName("Account"); r.setInstitutionId("Inst1"); r.setDescription("Desc1"); r.setNumber("Number"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setValue("Key", "Value"); MyMoneyAccount a(id, r); @@ -125,11 +125,11 @@ void MyMoneyAccountTest::testCopyConstructor() { CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == institutionid); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Expense); - CPPUNIT_ASSERT(b.lastModified() == QDate::currentDate()); - CPPUNIT_ASSERT(b.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(b.openingDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(b.description() == "Desc1"); CPPUNIT_ASSERT(b.number() == "Number"); - CPPUNIT_ASSERT(b.parentAccountId() == "ParentAccount"); + CPPUNIT_ASSERT(b.tqparentAccountId() == "ParentAccount"); CPPUNIT_ASSERT(b.value("Key") == "Value"); } @@ -146,14 +146,14 @@ void MyMoneyAccountTest::testAssignmentConstructor() { MyMoneyAccount b; - b.setLastModified(QDate::currentDate()); + b.setLastModified(TQDate::tqcurrentDate()); b = a; CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == "Inst1"); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Checkings); - CPPUNIT_ASSERT(b.lastModified() == QDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate()); CPPUNIT_ASSERT(b.openingDate() == a.openingDate()); CPPUNIT_ASSERT(b.description() == "Bla"); CPPUNIT_ASSERT(b.number() == "assigned Number"); @@ -176,7 +176,7 @@ void MyMoneyAccountTest::testAdjustBalance() { a.adjustBalance(s); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-4,1)); s.setShares(MyMoneyMoney(4,1)); - s.setAction(QString()); + s.setAction(TQString()); a.adjustBalance(s); CPPUNIT_ASSERT(a.balance().isZero()); } @@ -199,13 +199,13 @@ void MyMoneyAccountTest::testEquality() { MyMoneyAccount a; - a.setLastModified(QDate::currentDate()); + a.setLastModified(TQDate::tqcurrentDate()); a.setName("Name"); a.setNumber("Number"); a.setDescription("Desc"); a.setInstitutionId("I-ID"); - a.setOpeningDate(QDate::currentDate()); - a.setLastReconciliationDate(QDate::currentDate()); + a.setOpeningDate(TQDate::tqcurrentDate()); + a.setLastReconciliationDate(TQDate::tqcurrentDate()); a.setAccountType(MyMoneyAccount::Asset); a.setParentAccountId("P-ID"); a.setId("A-ID"); @@ -221,7 +221,7 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastModified(QDate::currentDate().addDays(-1)); + a.setLastModified(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -237,11 +237,11 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setOpeningDate(QDate::currentDate().addDays(-1)); + a.setOpeningDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastReconciliationDate(QDate::currentDate().addDays(-1)); + a.setLastReconciliationDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -272,35 +272,35 @@ void MyMoneyAccountTest::testEquality() } void MyMoneyAccountTest::testWriteXML() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setName("AccountName"); r.setNumber("465500"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setInstitutionId(institutionid); - r.setValue(QString("key"), "value"); + r.setValue(TQString("key"), "value"); r.addAccountId("A000002"); // CPPUNIT_ASSERT(r.m_kvp.count() == 1); // CPPUNIT_ASSERT(r.value("key") == "value"); MyMoneyAccount a(id, r); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("ACCOUNT-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("ACCOUNT-CONTAINER"); doc.appendChild(el); a.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <ACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <ACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " </SUBACCOUNTS>\n" @@ -309,17 +309,17 @@ void MyMoneyAccountTest::testWriteXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } void MyMoneyAccountTest::testReadXML() { MyMoneyAccount a; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <ACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <ACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " <SUBACCOUNT id=\"A000003\" />\n" @@ -330,12 +330,12 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <KACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <KACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " <SUBACCOUNT id=\"A000003\" />\n" @@ -346,10 +346,10 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </KACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(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(); @@ -371,11 +371,11 @@ void MyMoneyAccountTest::testReadXML() { CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.m_name == "AccountName"); CPPUNIT_ASSERT(a.m_parentAccount == "Parent"); - CPPUNIT_ASSERT(a.m_lastModified == QDate::currentDate()); - CPPUNIT_ASSERT(a.m_lastReconciliationDate == QDate()); + CPPUNIT_ASSERT(a.m_lastModified == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.m_lastReconciliationDate == TQDate()); CPPUNIT_ASSERT(a.m_institution == "B000001"); CPPUNIT_ASSERT(a.m_number == "465500"); - CPPUNIT_ASSERT(a.m_openingDate == QDate::currentDate()); + CPPUNIT_ASSERT(a.m_openingDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.m_accountType == MyMoneyAccount::Asset); CPPUNIT_ASSERT(a.m_description == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 2); |