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/mymoneymoneytest.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/mymoneymoneytest.cpp')
-rw-r--r-- | kmymoney2/mymoney/mymoneymoneytest.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kmymoney2/mymoney/mymoneymoneytest.cpp b/kmymoney2/mymoney/mymoneymoneytest.cpp index 64c2961..81967a1 100644 --- a/kmymoney2/mymoney/mymoneymoneytest.cpp +++ b/kmymoney2/mymoney/mymoneymoneytest.cpp @@ -97,15 +97,15 @@ void MyMoneyMoneyTest::testAssignment() CPPUNIT_ASSERT(m->m_num == -5678); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-987"); + *m = TQString("-987"); CPPUNIT_ASSERT(m->m_num == -987); CPPUNIT_ASSERT(m->m_denom == 1); - *m = QString("9998887776665554.44"); + *m = TQString("9998887776665554.44"); CPPUNIT_ASSERT(m->m_num == 999888777666555444LL); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-99988877766655.444"); + *m = TQString("-99988877766655.444"); CPPUNIT_ASSERT(m->m_num == -99988877766655444LL); CPPUNIT_ASSERT(m->m_denom == 1000); @@ -179,22 +179,22 @@ void MyMoneyMoneyTest::testConvert() MyMoneyMoney b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-123.456"); + a = TQString("-123.456"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == -12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("123.1"); + a = TQString("123.1"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12310); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-73010.28"); - b = QString("1.95583"); - CPPUNIT_ASSERT((a * b).convert(100) == QString("-142795.70")); + a = TQString("-73010.28"); + b = TQString("1.95583"); + CPPUNIT_ASSERT((a * b).convert(100) == TQString("-142795.70")); - a = QString("-142795.69"); - CPPUNIT_ASSERT((a / b).convert(100) == QString("-73010.28")); + a = TQString("-142795.69"); + CPPUNIT_ASSERT((a / b).convert(100) == TQString("-73010.28")); } void MyMoneyMoneyTest::testEquality() @@ -216,7 +216,7 @@ void MyMoneyMoneyTest::testEquality() CPPUNIT_ASSERT(m5 == m6); CPPUNIT_ASSERT(m5 == m7); - CPPUNIT_ASSERT(m5 == QString("369/30")); + CPPUNIT_ASSERT(m5 == TQString("369/30")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc == MyMoneyMoney::autoCalc); } @@ -234,7 +234,7 @@ void MyMoneyMoneyTest::testInequality() MyMoneyMoney m4(LLCONST(999666555444)); CPPUNIT_ASSERT(m3 != m4); - CPPUNIT_ASSERT(m4 != QString("999666555444")); + CPPUNIT_ASSERT(m4 != TQString("999666555444")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc != MyMoneyMoney(1,100)); CPPUNIT_ASSERT(MyMoneyMoney(1,100) != MyMoneyMoney::autoCalc); @@ -258,9 +258,9 @@ void MyMoneyMoneyTest::testAddition() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(101)); // CPPUNIT_ASSERT((++m1) == MyMoneyMoney(102)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(40, 1000); - CPPUNIT_ASSERT((m1 + m2) == QString("123.24")); + CPPUNIT_ASSERT((m1 + m2) == TQString("123.24")); m1 += m2; CPPUNIT_ASSERT(m1.m_num == 123240); @@ -284,7 +284,7 @@ void MyMoneyMoneyTest::testSubtraction() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(99)); // CPPUNIT_ASSERT((--m1) == MyMoneyMoney(98)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(1, 5); CPPUNIT_ASSERT((m1 - m2) == MyMoneyMoney(123,1)); @@ -301,9 +301,9 @@ void MyMoneyMoneyTest::testMultiplication() CPPUNIT_ASSERT((m1 * MyMoneyMoney(10000000,1)) == MyMoneyMoney(1000000000,1)); CPPUNIT_ASSERT((m1 * (*m_0)) == MyMoneyMoney(1200)); - MyMoneyMoney m2 = QString("-73010.28"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m1 * m2) == QString("-142795.6959324")); + MyMoneyMoney m2 = TQString("-73010.28"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m1 * m2) == TQString("-142795.6959324")); } void MyMoneyMoneyTest::testDivision() @@ -311,9 +311,9 @@ void MyMoneyMoneyTest::testDivision() MyMoneyMoney m1(100); CPPUNIT_ASSERT((m1 / MyMoneyMoney(50)) == MyMoneyMoney(2,1)); - MyMoneyMoney m2 = QString("-142795.69"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m2 / m1).convert(100000000) == QString("-73010.27696681")); + MyMoneyMoney m2 = TQString("-142795.69"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m2 / m1).convert(100000000) == TQString("-73010.27696681")); MyMoneyMoney m3 = MyMoneyMoney(0) / MyMoneyMoney(100); CPPUNIT_ASSERT(m3.m_num == 0); @@ -325,12 +325,12 @@ void MyMoneyMoneyTest::testSetDecimalSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == '.'); MyMoneyMoney::setDecimalSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000:00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2,000:00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000:00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2,000:00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == ':'); } @@ -340,57 +340,57 @@ void MyMoneyMoneyTest::testSetThousandSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ','); MyMoneyMoney::setThousandSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1:000.00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2:000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1:000.00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2:000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ':'); } void MyMoneyMoneyTest::testFormatMoney() { - CPPUNIT_ASSERT(m_0->formatMoney("", 2) == QString("0.12")); - CPPUNIT_ASSERT(m_1->formatMoney("", 2) == QString("-0.10")); + CPPUNIT_ASSERT(m_0->formatMoney("", 2) == TQString("0.12")); + CPPUNIT_ASSERT(m_1->formatMoney("", 2) == TQString("-0.10")); MyMoneyMoney m1(10099); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.99")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.99")); m1 = MyMoneyMoney(100,1); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("100")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("100")); m1 = m1 * 10; - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("1,000")); - CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == QString("1000")); - CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == QString("1000.000")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("1,000")); + CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == TQString("1000")); + CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == TQString("1000.000")); m1 = MyMoneyMoney(INT64_MAX, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("92233720368547758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("92233720368547758.07")); m1 = MyMoneyMoney(INT64_MIN, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("-92233720368547758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("-92233720368547758.08")); m1 = MyMoneyMoney(1,5); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(1000) == QString("0.200")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(10) == QString("0.2")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(1000) == TQString("0.200")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(10) == TQString("0.2")); m1 = MyMoneyMoney(13333,5000); - CPPUNIT_ASSERT(m1.formatMoney("", 10) == QString("2.6666000000")); + CPPUNIT_ASSERT(m1.formatMoney("", 10) == TQString("2.6666000000")); m1 = MyMoneyMoney(-1404,100); - CPPUNIT_ASSERT(m1.formatMoney("",-1) == QString("-14.04")); + CPPUNIT_ASSERT(m1.formatMoney("",-1) == TQString("-14.04")); } void MyMoneyMoneyTest::testRelation() @@ -409,17 +409,17 @@ void MyMoneyMoneyTest::testRelation() CPPUNIT_ASSERT(m3 >= m3); // tests with different denominator - m1 = QString("1/8"); - m2 = QString("1/7"); + m1 = TQString("1/8"); + m2 = TQString("1/7"); CPPUNIT_ASSERT(m1 < m2); CPPUNIT_ASSERT(m2 > m1); - m2 = QString("-1/7"); + m2 = TQString("-1/7"); CPPUNIT_ASSERT(m2 < m1); CPPUNIT_ASSERT(m1 > m2); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m2 <= m1); - m1 = QString("-2/14"); + m1 = TQString("-2/14"); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m1 <= m2); @@ -462,9 +462,9 @@ void MyMoneyMoneyTest::testToString() MyMoneyMoney m2(1234); MyMoneyMoney m3; - CPPUNIT_ASSERT(m1.toString() == QString("-100/100")); - CPPUNIT_ASSERT(m2.toString() == QString("1234/100")); - CPPUNIT_ASSERT(m3.toString() == QString("0/1")); + CPPUNIT_ASSERT(m1.toString() == TQString("-100/100")); + CPPUNIT_ASSERT(m2.toString() == TQString("1234/100")); + CPPUNIT_ASSERT(m3.toString() == TQString("0/1")); } void MyMoneyMoneyTest::testNegativeSignPos(void) |