1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2009-06-11
7  * Description : An unit-test to print metadata tags from file using DMetadata.
8  *
9  * Copyright (C) 2009-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_PRINT_METADATA_UTEST_H
25 #define DIGIKAM_PRINT_METADATA_UTEST_H
26 
27 // Local includes
28 
29 #include "abstractunittest.h"
30 #include "dmetadata.h"
31 
32 using namespace Digikam;
33 
34 class PrintMetadataTest : public AbstractUnitTest
35 {
36     Q_OBJECT
37 
38 public:
39 
40     explicit PrintMetadataTest(QObject* const parent = nullptr);
41 
42 private:
43 
44     void printMetadataMap(const DMetadata::MetaDataMap& map);
45     void printMetadata(const QString& filePath, bool exif, bool iptc, bool xmp, bool expectedRead);
46 
47     /// NOTE: 'expected' paramareters want mean that we expect a metadata tags map non empty
48     void loadExif(const DMetadata& meta, bool expected);
49     void loadIptc(const DMetadata& meta, bool expected);
50     void loadXmp(const DMetadata& meta, bool expected);
51 
52 private Q_SLOTS:
53 
54     void testPrintMetadata();
55 };
56 
57 #endif // DIGIKAM_PRINT_METADATA_UTEST_H
58