File indexing completed on 2024-05-12 16:45:21
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 { 0029 // Test import KMY 0030 SKGDocumentBank document1; 0031 SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true) 0032 SKGError err; 0033 { 0034 // Scope of the transaction 0035 SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_KMY"), err) 0036 0037 SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportkmy2/to_skrooge.anon.kmy")); 0038 SKGTESTERROR(QStringLiteral("KMY.importFile"), imp1.importFile(), true) 0039 } 0040 } 0041 0042 // End test 0043 SKGENDTEST() 0044 }