1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2021 S. MANKOWSKI stephane@mankowski.fr
3  * SPDX-FileCopyrightText: 2021 G. DE BURE support@mankowski.fr
4  * SPDX-License-Identifier: GPL-3.0-or-later
5  ***************************************************************************/
6 /** @file
7  * This file is a test script.
8  *
9  * @author Stephane MANKOWSKI / Guillaume DE BURE
10  */
11 #include "skgtestmacro.h"
12 #include "skgbankincludes.h"
13 #include "skgimportexportmanager.h"
14 
15 /**
16  * The main function of the unit test
17  * @param argc the number of arguments
18  * @param argv the list of arguments
19  */
main(int argc,char ** argv)20 int main(int argc, char** argv)
21 {
22     Q_UNUSED(argc)
23     Q_UNUSED(argv)
24 
25     // Init test
26     SKGINITTEST(true)
27 
28     {
29         // Test import KMY
30         SKGDocumentBank document1;
31         SKGTESTERROR(QStringLiteral("document1.initialize()"), document1.initialize(), true)
32         SKGError err;
33         {
34             // Scope of the transaction
35             SKGBEGINTRANSACTION(document1, QStringLiteral("IMPORT_KMY"), err)
36 
37             SKGImportExportManager imp1(&document1, QUrl::fromLocalFile(SKGTest::getTestPath(QStringLiteral("IN")) % "/skgtestimportkmy2/to_skrooge.anon.kmy"));
38             SKGTESTERROR(QStringLiteral("KMY.importFile"), imp1.importFile(), true)
39         }
40     }
41 
42     // End test
43     SKGENDTEST()
44 }
45