forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kmymoney-4.8.0-tests.patch
210 lines (186 loc) · 7.13 KB
/
kmymoney-4.8.0-tests.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
From: Cristian Oneț <[email protected]>
Date: Thu, 16 Jun 2016 07:06:32 +0000
Subject: Fix the tests of the 4.8 build.
X-Git-Url: http://quickgit.kde.org/?p=kmymoney.git&a=commitdiff&h=29ab40829f86f6bd32229ededcc09bf2736e67bd
---
Fix the tests of the 4.8 build.
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.
BUG: 364355
---
--- a/kmymoney/mymoney/storage/mymoneymap.h
+++ b/kmymoney/mymoney/storage/mymoneymap.h
@@ -195,7 +195,7 @@
that = *(dynamic_cast<QMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this)));
}
- inline size_t count(void) const {
+ inline int count(void) const {
return QMap<Key, T>::count();
}
--- a/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp
+++ b/kmymoney/mymoney/storage/mymoneyseqaccessmgrtest.cpp
@@ -58,13 +58,13 @@
QCOMPARE(m->m_nextPayeeID, 0ul);
QCOMPARE(m->m_nextScheduleID, 0ul);
QCOMPARE(m->m_nextReportID, 0ul);
- QCOMPARE(m->m_institutionList.count(), 0ul);
- QCOMPARE(m->m_accountList.count(), 5ul);
- QCOMPARE(m->m_transactionList.count(), 0ul);
- QCOMPARE(m->m_transactionKeys.count(), 0ul);
- QCOMPARE(m->m_payeeList.count(), 0ul);
- QCOMPARE(m->m_tagList.count(), 0ul);
- QCOMPARE(m->m_scheduleList.count(), 0ul);
+ QCOMPARE(m->m_institutionList.count(), 0);
+ QCOMPARE(m->m_accountList.count(), 5);
+ QCOMPARE(m->m_transactionList.count(), 0);
+ QCOMPARE(m->m_transactionKeys.count(), 0);
+ QCOMPARE(m->m_payeeList.count(), 0);
+ QCOMPARE(m->m_tagList.count(), 0);
+ QCOMPARE(m->m_scheduleList.count(), 0);
QCOMPARE(m->m_dirty, false);
QCOMPARE(m->m_creationDate, QDate::currentDate());
@@ -187,7 +187,7 @@
QCOMPARE(m->m_nextAccountID, 1ul);
QCOMPARE(m->dirty(), true);
- QCOMPARE(m->m_accountList.count(), static_cast<std::size_t>(6));
+ QCOMPARE(m->m_accountList.count(), 6);
QCOMPARE(m->m_accountList["A000001"].name(), QLatin1String("AccountName"));
}
@@ -235,7 +235,7 @@
m->m_dirty = false;
QCOMPARE(m->m_nextAccountID, 2ul);
- QCOMPARE(m->m_accountList.count(), static_cast<std::size_t>(7));
+ QCOMPARE(m->m_accountList.count(), 7);
// try to add account to undefined account
try {
@@ -271,7 +271,7 @@
i.setName("Inst Name");
m->addInstitution(i);
- QCOMPARE(m->m_institutionList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_institutionList.count(), 1);
QCOMPARE(m->m_nextInstitutionID, 1ul);
QCOMPARE(m->m_institutionList["I000001"].name(), QLatin1String("Inst Name"));
}
@@ -950,11 +950,11 @@
// check that we can remove an unreferenced payee
MyMoneyPayee p = m->payee("P000001");
try {
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_payeeList.count(), 1);
m->removePayee(p);
m->commitTransaction();
m->startTransaction();
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_payeeList.count(), 0);
QCOMPARE(m->dirty(), true);
} catch (const MyMoneyException &) {
QFAIL("Unexpected exception");
@@ -996,7 +996,7 @@
QFAIL("Expected exception");
} catch (const MyMoneyException &) {
}
- QCOMPARE(m->m_payeeList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_payeeList.count(), 1);
}
void MyMoneySeqAccessMgrTest::testAddTag()
@@ -1046,11 +1046,11 @@
// check that we can remove an unreferenced tag
MyMoneyTag ta = m->tag("G000001");
try {
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_tagList.count(), 1);
m->removeTag(ta);
m->commitTransaction();
m->startTransaction();
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_tagList.count(), 0);
QCOMPARE(m->dirty(), true);
} catch (const MyMoneyException &) {
QFAIL("Unexpected exception");
@@ -1094,7 +1094,7 @@
QFAIL("Expected exception");
} catch (const MyMoneyException &) {
}
- QCOMPARE(m->m_tagList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_tagList.count(), 1);
}
void MyMoneySeqAccessMgrTest::testRemoveAccountFromTree()
@@ -1267,7 +1267,7 @@
try {
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_scheduleList.count(), 0);
MyMoneyTransaction t1;
MyMoneySplit s1, s2;
s1.setAccountId("A000001");
@@ -1287,7 +1287,7 @@
m->addSchedule(schedule);
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_scheduleList.count(), 1);
QCOMPARE(schedule.id(), QLatin1String("SCH000001"));
QCOMPARE(m->m_scheduleList["SCH000001"].id(), QLatin1String("SCH000001"));
} catch (const MyMoneyException &) {
@@ -1342,7 +1342,7 @@
sched.setName("New Sched-Name");
try {
m->modifySchedule(sched);
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_scheduleList.count(), 1);
QCOMPARE(m->m_scheduleList["SCH000001"].name(), QLatin1String("New Sched-Name"));
} catch (const MyMoneyException &) {
@@ -1373,7 +1373,7 @@
try {
m->removeSchedule(sched);
m->commitTransaction();
- QCOMPARE(m->m_scheduleList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_scheduleList.count(), 0);
} catch (const MyMoneyException &) {
m->rollbackTransaction();
@@ -1548,13 +1548,13 @@
void MyMoneySeqAccessMgrTest::testAddCurrency()
{
MyMoneySecurity curr("EUR", "Euro", "?", 100, 100);
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_currencyList.count(), 0);
m->m_dirty = false;
try {
m->addCurrency(curr);
m->commitTransaction();
m->startTransaction();
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_currencyList.count(), 1);
QCOMPARE(m->m_currencyList["EUR"].name(), QLatin1String("Euro"));
QCOMPARE(m->dirty(), true);
} catch (const MyMoneyException &) {
@@ -1582,7 +1582,7 @@
m->modifyCurrency(curr);
m->commitTransaction();
m->startTransaction();
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_currencyList.count(), 1);
QCOMPARE(m->m_currencyList["EUR"].name(), QLatin1String("EURO"));
QCOMPARE(m->dirty(), true);
} catch (const MyMoneyException &) {
@@ -1611,7 +1611,7 @@
m->removeCurrency(curr);
m->commitTransaction();
m->startTransaction();
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(0));
+ QCOMPARE(m->m_currencyList.count(), 0);
QCOMPARE(m->dirty(), true);
} catch (const MyMoneyException &) {
QFAIL("Unexpected exception");
@@ -1668,7 +1668,7 @@
try {
m->addCurrency(unknownCurr);
m->m_dirty = false;
- QCOMPARE(m->m_currencyList.count(), static_cast<std::size_t>(2));
+ QCOMPARE(m->m_currencyList.count(), 2);
QCOMPARE(m->currencyList().count(), 2);
QCOMPARE(m->dirty(), false);
} catch (const MyMoneyException &) {
@@ -1797,7 +1797,7 @@
QCOMPARE(m->m_nextOnlineJobID, 1ul);
QCOMPARE(m->dirty(), true);
- QCOMPARE(m->m_onlineJobList.count(), static_cast<std::size_t>(1));
+ QCOMPARE(m->m_onlineJobList.count(), 1);
QVERIFY(! m->m_onlineJobList["O000001"].isNull());
}