File indexing completed on 2025-01-05 03:58:14

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-06-11
0007  * Description : An unit-test to print metadata tags from file using DMetadata.
0008  *
0009  * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_PRINT_METADATA_UTEST_H
0016 #define DIGIKAM_PRINT_METADATA_UTEST_H
0017 
0018 // Local includes
0019 
0020 #include "abstractunittest.h"
0021 #include "dmetadata.h"
0022 
0023 using namespace Digikam;
0024 
0025 class PrintMetadataTest : public AbstractUnitTest
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030 
0031     explicit PrintMetadataTest(QObject* const parent = nullptr);
0032 
0033 private:
0034 
0035     void printMetadataMap(const DMetadata::MetaDataMap& map);
0036     void printMetadata(const QString& filePath, bool exif, bool iptc, bool xmp, bool expectedRead);
0037 
0038     /// NOTE: 'expected' paramareters want mean that we expect a metadata tags map non empty
0039     void loadExif(const DMetadata& meta, bool expected);
0040     void loadIptc(const DMetadata& meta, bool expected);
0041     void loadXmp(const DMetadata& meta, bool expected);
0042 
0043 private Q_SLOTS:
0044 
0045     void testPrintMetadata();
0046 };
0047 
0048 #endif // DIGIKAM_PRINT_METADATA_UTEST_H