File indexing completed on 2024-05-12 16:45:23
0001 /*************************************************************************** 0002 * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr 0003 * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 ***************************************************************************/ 0006 /** @file 0007 * This file is a test script. 0008 * 0009 * @author Stephane MANKOWSKI / Guillaume DE BURE 0010 */ 0011 #include "skgtestmacro.h" 0012 #include "skgbankincludes.h" 0013 #include "skgimportexportmanager.h" 0014 0015 /** 0016 * The main function of the unit test 0017 * @param argc the number of arguments 0018 * @param argv the list of arguments 0019 */ 0020 int main(int argc, char** argv) 0021 { 0022 Q_UNUSED(argc) 0023 Q_UNUSED(argv) 0024 0025 // Init test 0026 SKGINITTEST(true) 0027 0028 QDate d(1970, 1, 1); 0029 0030 { 0031 // 275963 0032 SKGDocumentBank document1; 0033 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0034 SKGBankObject bank(&document1); 0035 SKGUnitObject unit_euro(&document1); 0036 SKGUnitObject unit_dollar(&document1); 0037 SKGError err; 0038 { 0039 SKGAccountObject account; 0040 0041 // Scope of the transaction 0042 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_INIT"), err) 0043 0044 // Creation unit 0045 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_euro.setName(QStringLiteral("euro")), true) 0046 SKGTESTERROR(QStringLiteral("UNIT:setSymbol"), unit_euro.setSymbol(QStringLiteral("EUR")), true) 0047 SKGTESTERROR(QStringLiteral("UNIT:setType"), unit_euro.setType(SKGUnitObject::PRIMARY), true) 0048 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_euro.save(), true) 0049 0050 // Creation unitvalue 0051 SKGUnitValueObject unit_euro_val1; 0052 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_euro.addUnitValue(unit_euro_val1), true) 0053 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_euro_val1.setQuantity(1), true) 0054 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_euro_val1.setDate(d), true) 0055 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_euro_val1.save(), true) 0056 0057 // Creation unit 0058 SKGTESTERROR(QStringLiteral("UNIT:setName"), unit_dollar.setName(QStringLiteral("dollar")), true) 0059 SKGTESTERROR(QStringLiteral("UNIT:setSymbol"), unit_dollar.setSymbol(QStringLiteral("USD")), true) 0060 SKGTESTERROR(QStringLiteral("UNIT:setType"), unit_dollar.setType(SKGUnitObject::CURRENCY), true) 0061 SKGTESTERROR(QStringLiteral("UNIT:save"), unit_dollar.save(), true) 0062 0063 // Creation unitvalue 0064 SKGUnitValueObject unit_dollar_val1; 0065 SKGTESTERROR(QStringLiteral("UNIT:addUnitValue"), unit_dollar.addUnitValue(unit_dollar_val1), true) 0066 SKGTESTERROR(QStringLiteral("UNITVALUE:setQuantity"), unit_dollar_val1.setQuantity(2), true) 0067 SKGTESTERROR(QStringLiteral("UNITVALUE:setDate"), unit_dollar_val1.setDate(d), true) 0068 SKGTESTERROR(QStringLiteral("UNITVALUE:save"), unit_dollar_val1.save(), true) 0069 0070 // Creation bank 0071 SKGTESTERROR(QStringLiteral("BANK:setName"), bank.setName(QStringLiteral("CREDIT COOP")), true) 0072 SKGTESTERROR(QStringLiteral("BANK:setNumber"), bank.setNumber(QStringLiteral("0003")), true) 0073 SKGTESTERROR(QStringLiteral("BANK:save"), bank.save(), true) 0074 0075 // Creation account 0076 SKGTESTERROR(QStringLiteral("BANK:addAccount"), bank.addAccount(account), true) 0077 SKGTESTERROR(QStringLiteral("ACCOUNT:setName"), account.setName(QStringLiteral("CODEVI")), true) 0078 SKGTESTERROR(QStringLiteral("ACCOUNT:save"), account.save(), true) 0079 SKGTESTERROR(QStringLiteral("ACCOUNT:setInitialBalance"), account.setInitialBalance(100, unit_dollar), true) 0080 SKGTESTERROR(QStringLiteral("ACCOUNT:save"), account.save(), true) 0081 } 0082 0083 0084 { 0085 // Scope of the transaction 0086 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0087 0088 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/t2.qif")); 0089 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0090 } 0091 { 0092 SKGAccountObject account(&document1); 0093 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("CODEVI")), true) 0094 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0095 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-9335.94")) 0096 } 0097 } 0098 0099 { 0100 // 275963 0101 SKGDocumentBank document1; 0102 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.load(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/export_qif.skg"), true) 0103 SKGError err; 0104 { 0105 // Scope of the transaction 0106 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_BP_QIF"), err) 0107 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif2/export_qif.qif")); 0108 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0109 } 0110 } 0111 0112 { 0113 // Support qif file having Type:Class with description 0114 SKGDocumentBank document1; 0115 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0116 SKGError err; 0117 SKGAccountObject la; 0118 { 0119 // Scope of the transaction 0120 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0121 0122 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/MoneydanceExportExample.qif")); 0123 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0124 0125 SKGObjectBase::SKGListSKGObjectBase result; 0126 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("account"), QStringLiteral("t_name='Wells Fargo:Checking'"), result), true) 0127 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 1) 0128 if (result.count() != 0) { 0129 la = result.at(0); 0130 } 0131 } 0132 { 0133 // Scope of the transaction 0134 SKGBEGINTRANSACTION(document1, QStringLiteral("EXPORT_QIF"), err) 0135 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif2/export_all.qif")); 0136 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0137 } 0138 { 0139 // Scope of the transaction 0140 SKGBEGINTRANSACTION(document1, QStringLiteral("EXPORT_QIF"), err) 0141 SKGImportExportManager exp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("OUT")) % "/skgtestimportqif2/export_la.qif")); 0142 QMap<QString, QString> params; 0143 params[QStringLiteral("uuid_of_selected_accounts_or_operations")] = la.getUniqueID(); 0144 exp1.setExportParameters(params); 0145 SKGTESTERROR(QStringLiteral("QIF.exportFile"), exp1.exportFile(), true) 0146 } 0147 } 0148 0149 { 0150 // Default account 0151 SKGDocumentBank document1; 0152 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0153 SKGError err; 0154 { 0155 // Scope of the transaction 0156 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0157 0158 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/LA-1234567@ing.qif")); 0159 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0160 } 0161 0162 { 0163 SKGBEGINTRANSACTION(document1, QStringLiteral("MODIF"), err) 0164 SKGObjectBase::SKGListSKGObjectBase result; 0165 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("bank"), QStringLiteral("t_name='ing'"), result), true) 0166 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 1) 0167 0168 SKGBankObject bank(result.at(0)); 0169 SKGTESTERROR(QStringLiteral("BANK.setName"), bank.setName(QStringLiteral("ING Direct")), true) 0170 SKGTESTERROR(QStringLiteral("BANK.save"), bank.save(), true) 0171 0172 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("account"), QStringLiteral("t_number='1234567'"), result), true) 0173 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 1) 0174 0175 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("account"), QStringLiteral("t_name='LA'"), result), true) 0176 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 1) 0177 0178 SKGAccountObject acc(result.at(0)); 0179 SKGTESTERROR(QStringLiteral("ACC.setName"), acc.setName(QStringLiteral("Livret A")), true) 0180 SKGTESTERROR(QStringLiteral("ACC.save"), acc.save(), true) 0181 } 0182 0183 { 0184 // Scope of the transaction 0185 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0186 0187 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/LA-1234567@ing.qif")); 0188 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0189 } 0190 0191 document1.dump(DUMPACCOUNT); 0192 { 0193 SKGObjectBase::SKGListSKGObjectBase result; 0194 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("account"), QStringLiteral("t_number='1234567'"), result), true) 0195 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 1) 0196 } 0197 } 0198 0199 { 0200 // Bug import date 0201 SKGDocumentBank document1; 0202 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0203 SKGError err; 0204 { 0205 // Scope of the transaction 0206 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0207 0208 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/date_money.qif")); 0209 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0210 } 0211 } 0212 0213 { 0214 // Autorepair 0215 SKGDocumentBank document1; 0216 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0217 SKGError err; 0218 { 0219 // Scope of the transaction 0220 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0221 0222 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/autorepair.qif")); 0223 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0224 } 0225 { 0226 SKGAccountObject account(&document1); 0227 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("autorepair")), true) 0228 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0229 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-400")) 0230 } 0231 } 0232 0233 { 0234 // Error 0235 SKGDocumentBank document1; 0236 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0237 SKGError err; 0238 { 0239 // Scope of the transaction 0240 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0241 0242 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/error.qif")); 0243 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0244 } 0245 } 0246 0247 { 0248 // Split and transfer 0249 SKGDocumentBank document1; 0250 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0251 SKGError err; 0252 { 0253 // Scope of the transaction 0254 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0255 0256 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/split_and_transfer.qif")); 0257 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0258 } 0259 { 0260 SKGAccountObject account(&document1); 0261 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Joint Checking")), true) 0262 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0263 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("-1181.25")) // -600 if sum of splits 0264 } 0265 { 0266 SKGAccountObject account(&document1); 0267 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("2012 Acadia Loan")), true) 0268 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0269 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("1162.5")) // 581.25 if sum of splits 0270 } 0271 } 0272 0273 { 0274 // Split and transfer 2 0275 SKGDocumentBank document1; 0276 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0277 SKGError err; 0278 { 0279 // Scope of the transaction 0280 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0281 0282 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/split_and_transfer_2.qif")); 0283 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0284 } 0285 { 0286 SKGAccountObject account(&document1); 0287 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Joint Checking")), true) 0288 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0289 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("2714.31")) 0290 } 0291 { 0292 SKGAccountObject account(&document1); 0293 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("Credit Union")), true) 0294 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0295 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("400")) 0296 } 0297 { 0298 SKGAccountObject account(&document1); 0299 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("TSP")), true) 0300 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0301 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("437.88")) 0302 } 0303 { 0304 SKGAccountObject account(&document1); 0305 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("FSA")), true) 0306 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0307 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("88.26")) 0308 } 0309 { 0310 SKGAccountObject account(&document1); 0311 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("TSP - Roth")), true) 0312 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0313 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("250")) 0314 } 0315 } 0316 0317 { 0318 // 400724 0319 SKGDocumentBank document1; 0320 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0321 SKGError err; 0322 { 0323 // Scope of the transaction 0324 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0325 0326 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/400724.qif")); 0327 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0328 } 0329 } 0330 0331 { 0332 // 402330 0333 SKGDocumentBank document1; 0334 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0335 SKGError err; 0336 { 0337 // Scope of the transaction 0338 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0339 0340 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/402330.qif")); 0341 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0342 } 0343 } 0344 0345 { 0346 // 403725 0347 SKGDocumentBank document1; 0348 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0349 SKGError err; 0350 { 0351 // Scope of the transaction 0352 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0353 0354 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/403725.qif")); 0355 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0356 } 0357 0358 SKGObjectBase::SKGListSKGObjectBase result; 0359 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("refund"), QLatin1String(""), result), true) 0360 SKGTEST(QStringLiteral("DOC.getObjects.count"), result.count(), 2) 0361 } 0362 0363 { 0364 // 406243 0365 SKGDocumentBank document1; 0366 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0367 SKGError err; 0368 { 0369 // Scope of the transaction 0370 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0371 0372 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/406243.qif")); 0373 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0374 } 0375 0376 { 0377 SKGAccountObject account(&document1); 0378 SKGTESTERROR(QStringLiteral("QIF.setName"), account.setName(QStringLiteral("406243")), true) 0379 SKGTESTERROR(QStringLiteral("QIF.load"), account.load(), true) 0380 SKGTEST(QStringLiteral("QIF:getValue"), SKGServices::doubleToString(account.getCurrentAmount()), QStringLiteral("794")) 0381 } 0382 } 0383 0384 { 0385 // 406243 0386 SKGDocumentBank document1; 0387 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0388 SKGError err; 0389 { 0390 // Scope of the transaction 0391 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0392 0393 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/406271.qif")); 0394 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0395 } 0396 0397 { 0398 SKGTrackerObject tracker(&document1); 0399 SKGTESTERROR(QStringLiteral("QIF.setName"), tracker.setName(QStringLiteral("Jane")), true) 0400 SKGTESTERROR(QStringLiteral("QIF.load"), tracker.load(), true) 0401 SKGTEST(QStringLiteral("QIF:getComment"), tracker.getComment(), QStringLiteral("expenses that Jane incurs")) 0402 } 0403 } 0404 0405 { 0406 // 406266 0407 SKGDocumentBank document1; 0408 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0409 SKGError err; 0410 { 0411 // Scope of the transaction 0412 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0413 0414 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/406266.qif")); 0415 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0416 } 0417 0418 { 0419 SKGUnitObject unit(&document1); 0420 SKGTESTERROR(QStringLiteral("QIF.setName"), unit.setName(QStringLiteral("ACME CORP")), true) 0421 SKGTESTERROR(QStringLiteral("QIF.load"), unit.load(), true) 0422 SKGTEST(QStringLiteral("QIF:getSymbol"), unit.getSymbol(), QStringLiteral("ACMW")) 0423 SKGTEST(QStringLiteral("QIF:getSymbol"), static_cast<unsigned int>(unit.getType()), static_cast<unsigned int>(SKGUnitObject::SHARE)) 0424 } 0425 } 0426 0427 { 0428 // 406270 0429 SKGDocumentBank document1; 0430 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0431 SKGError err; 0432 { 0433 // Scope of the transaction 0434 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0435 0436 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/406270.qif")); 0437 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0438 } 0439 0440 SKGObjectBase::SKGListSKGObjectBase result; 0441 SKGTESTERROR(QStringLiteral("DOC.getObjects"), document1.getObjects(QStringLiteral("unit"), QLatin1String(""), result), true) 0442 SKGTEST(QStringLiteral("DOC.getObjects.count"), static_cast<unsigned int>(result.count()), static_cast<unsigned int>(1)) 0443 } 0444 0445 { 0446 // BUG 0447 SKGDocumentBank document1; 0448 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0449 SKGError err; 0450 { 0451 // Scope of the transaction 0452 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT"), err) 0453 0454 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportqif2/bug.qif")); 0455 SKGTESTERROR(QStringLiteral("QIF.importFile"), imp1.importFile(), true) 0456 } 0457 } 0458 // End test 0459 SKGENDTEST() 0460 }