|
Rex Dieter |
a58b0a0 |
From 29ab40829f86f6bd32229ededcc09bf2736e67bd Mon Sep 17 00:00:00 2001
|
|
Rex Dieter |
a58b0a0 |
From: =?UTF-8?q?Cristian=20One=C8=9B?= <onet.cristian@gmail.com>
|
|
Rex Dieter |
a58b0a0 |
Date: Thu, 16 Jun 2016 09:06:32 +0200
|
|
Rex Dieter |
a58b0a0 |
Subject: [PATCH 03/22] Fix the tests of the 4.8 build.
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
Do this by backporting the change that is already in frameworks in commit 77085ff468336f26f6bcf5f2a1a08e16409172e6. Did not use cherry pick because the testfile was moved in frameworks.
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
BUG: 364355
|
|
Rex Dieter |
a58b0a0 |
---
|
|
Rex Dieter |
a58b0a0 |
kmymoney/mymoney/storage/mymoneymap.h | 2 +-
|
|
Rex Dieter |
a58b0a0 |
.../mymoney/storage/mymoneyseqaccessmgrtest.cpp | 52 +++++++++++-----------
|
|
Rex Dieter |
a58b0a0 |
2 files changed, 27 insertions(+), 27 deletions(-)
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
diff --git a/kmymoney/mymoney/storage/mymoneymap.h b/kmymoney/mymoney/storage/mymoneymap.h
|
|
Rex Dieter |
a58b0a0 |
index 0392d06..4dbdf3b 100644
|
|
Rex Dieter |
a58b0a0 |
--- a/kmymoney/mymoney/storage/mymoneymap.h
|
|
Rex Dieter |
a58b0a0 |
+++ b/kmymoney/mymoney/storage/mymoneymap.h
|
|
Rex Dieter |
a58b0a0 |
@@ -195,7 +195,7 @@ public:
|
|
Rex Dieter |
a58b0a0 |
that = *(dynamic_cast<QMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this)));
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
- inline size_t count(void) const {
|
|
Rex Dieter |
a58b0a0 |
+ inline int count(void) const {
|
|
Rex Dieter |
a58b0a0 |
return QMap<Key, T>::count();
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
diff --git a/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp
|
|
Rex Dieter |
a58b0a0 |
index dcb4b4a..58f387e 100644
|
|
Rex Dieter |
a58b0a0 |
--- a/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp
|
|
Rex Dieter |
a58b0a0 |
+++ b/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp
|
|
Rex Dieter |
a58b0a0 |
@@ -58,13 +58,13 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor()
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextPayeeID, 0ul);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextScheduleID, 0ul);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextReportID, 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_institutionList.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_accountList.count(), 5ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_transactionList.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_transactionKeys.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_payeeList.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_tagList.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_scheduleList.count(), 0ul);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_institutionList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_accountList.count(), 5);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_transactionList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_transactionKeys.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_payeeList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_tagList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_scheduleList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_dirty, false);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_creationDate, QDate::currentDate());
|
|
Rex Dieter |
a58b0a0 |
@@ -187,7 +187,7 @@ void MyMoneySeqAccessMgrTest::testNewAccount()
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextAccountID, 1ul);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_accountList.count(), static_cast<std::size_t>(6));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_accountList.count(), 6);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_accountList["A000001"].name(), QLatin1String("AccountName"));
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
@@ -235,7 +235,7 @@ void MyMoneySeqAccessMgrTest::testAddNewAccount()
|
|
Rex Dieter |
a58b0a0 |
m->m_dirty = false;
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextAccountID, 2ul);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_accountList.count(), static_cast<std::size_t>(7));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_accountList.count(), 7);
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
// try to add account to undefined account
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
@@ -271,7 +271,7 @@ void MyMoneySeqAccessMgrTest::testAddInstitution()
|
|
Rex Dieter |
a58b0a0 |
i.setName("Inst Name");
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
m->addInstitution(i);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_institutionList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_institutionList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextInstitutionID, 1ul);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_institutionList["I000001"].name(), QLatin1String("Inst Name"));
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
@@ -950,11 +950,11 @@ void MyMoneySeqAccessMgrTest::testRemovePayee()
|
|
Rex Dieter |
a58b0a0 |
// check that we can remove an unreferenced payee
|
|
Rex Dieter |
a58b0a0 |
MyMoneyPayee p = m->payee("P000001");
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_payeeList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
m->removePayee(p);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
m->startTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_payeeList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
QFAIL("Unexpected exception");
|
|
Rex Dieter |
a58b0a0 |
@@ -996,7 +996,7 @@ void MyMoneySeqAccessMgrTest::testRemovePayee()
|
|
Rex Dieter |
a58b0a0 |
QFAIL("Expected exception");
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_payeeList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
void MyMoneySeqAccessMgrTest::testAddTag()
|
|
Rex Dieter |
a58b0a0 |
@@ -1046,11 +1046,11 @@ void MyMoneySeqAccessMgrTest::testRemoveTag()
|
|
Rex Dieter |
a58b0a0 |
// check that we can remove an unreferenced tag
|
|
Rex Dieter |
a58b0a0 |
MyMoneyTag ta = m->tag("G000001");
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_tagList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
m->removeTag(ta);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
m->startTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_tagList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
QFAIL("Unexpected exception");
|
|
Rex Dieter |
a58b0a0 |
@@ -1094,7 +1094,7 @@ void MyMoneySeqAccessMgrTest::testRemoveTag()
|
|
Rex Dieter |
a58b0a0 |
QFAIL("Expected exception");
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_tagList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
void MyMoneySeqAccessMgrTest::testRemoveAccountFromTree()
|
|
Rex Dieter |
a58b0a0 |
@@ -1267,7 +1267,7 @@ void MyMoneySeqAccessMgrTest::testAddSchedule()
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_scheduleList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
MyMoneyTransaction t1;
|
|
Rex Dieter |
a58b0a0 |
MyMoneySplit s1, s2;
|
|
Rex Dieter |
a58b0a0 |
s1.setAccountId("A000001");
|
|
Rex Dieter |
a58b0a0 |
@@ -1287,7 +1287,7 @@ void MyMoneySeqAccessMgrTest::testAddSchedule()
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
m->addSchedule(schedule);
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_scheduleList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(schedule.id(), QLatin1String("SCH000001"));
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_scheduleList["SCH000001"].id(), QLatin1String("SCH000001"));
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
@@ -1342,7 +1342,7 @@ void MyMoneySeqAccessMgrTest::testModifySchedule()
|
|
Rex Dieter |
a58b0a0 |
sched.setName("New Sched-Name");
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
m->modifySchedule(sched);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_scheduleList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_scheduleList["SCH000001"].name(), QLatin1String("New Sched-Name"));
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
@@ -1373,7 +1373,7 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule()
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
m->removeSchedule(sched);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_scheduleList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
m->rollbackTransaction();
|
|
Rex Dieter |
a58b0a0 |
@@ -1548,13 +1548,13 @@ void MyMoneySeqAccessMgrTest::testScheduleList()
|
|
Rex Dieter |
a58b0a0 |
void MyMoneySeqAccessMgrTest::testAddCurrency()
|
|
Rex Dieter |
a58b0a0 |
{
|
|
Rex Dieter |
a58b0a0 |
MyMoneySecurity curr("EUR", "Euro", "?", 100, 100);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_currencyList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
m->m_dirty = false;
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
m->addCurrency(curr);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
m->startTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_currencyList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_currencyList["EUR"].name(), QLatin1String("Euro"));
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
@@ -1582,7 +1582,7 @@ void MyMoneySeqAccessMgrTest::testModifyCurrency()
|
|
Rex Dieter |
a58b0a0 |
m->modifyCurrency(curr);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
m->startTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_currencyList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_currencyList["EUR"].name(), QLatin1String("EURO"));
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
@@ -1611,7 +1611,7 @@ void MyMoneySeqAccessMgrTest::testRemoveCurrency()
|
|
Rex Dieter |
a58b0a0 |
m->removeCurrency(curr);
|
|
Rex Dieter |
a58b0a0 |
m->commitTransaction();
|
|
Rex Dieter |
a58b0a0 |
m->startTransaction();
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(0));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_currencyList.count(), 0);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
QFAIL("Unexpected exception");
|
|
Rex Dieter |
a58b0a0 |
@@ -1668,7 +1668,7 @@ void MyMoneySeqAccessMgrTest::testCurrencyList()
|
|
Rex Dieter |
a58b0a0 |
try {
|
|
Rex Dieter |
a58b0a0 |
m->addCurrency(unknownCurr);
|
|
Rex Dieter |
a58b0a0 |
m->m_dirty = false;
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(2));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_currencyList.count(), 2);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->currencyList().count(), 2);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), false);
|
|
Rex Dieter |
a58b0a0 |
} catch (const MyMoneyException &) {
|
|
Rex Dieter |
a58b0a0 |
@@ -1797,7 +1797,7 @@ void MyMoneySeqAccessMgrTest::testAddOnlineJob()
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->m_nextOnlineJobID, 1ul);
|
|
Rex Dieter |
a58b0a0 |
QCOMPARE(m->dirty(), true);
|
|
Rex Dieter |
a58b0a0 |
- QCOMPARE(m->m_onlineJobList.count(), static_cast<std::size_t>(1));
|
|
Rex Dieter |
a58b0a0 |
+ QCOMPARE(m->m_onlineJobList.count(), 1);
|
|
Rex Dieter |
a58b0a0 |
QVERIFY(! m->m_onlineJobList["O000001"].isNull());
|
|
Rex Dieter |
a58b0a0 |
|
|
Rex Dieter |
a58b0a0 |
}
|
|
Rex Dieter |
a58b0a0 |
--
|
|
Rex Dieter |
a58b0a0 |
2.7.4
|
|
Rex Dieter |
a58b0a0 |
|