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 : 2015-08-12 0007 * Description : metadata settings tests for getImageRating and setImageRating. 0008 * 0009 * SPDX-FileCopyrightText: 2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_RATING_READ_WRITE_UTEST_H 0016 #define DIGIKAM_RATING_READ_WRITE_UTEST_H 0017 0018 // Qt includes 0019 0020 #include <QObject> 0021 #include <QStringList> 0022 0023 class RatingReadWriteTest : public QObject 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 0029 explicit RatingReadWriteTest(QObject* const parent = nullptr); 0030 0031 private Q_SLOTS: 0032 0033 void initTestCase(); 0034 void cleanupTestCase(); 0035 0036 /** 0037 * @brief testSimpleReadAfterWrite - default read and write 0038 * Description: 0039 * Load default values, write then read a set of tags 0040 * Results: Values must match 0041 */ 0042 void testSimpleReadAfterWrite(); 0043 0044 /** 0045 * @brief testWriteToDisabledNamespaces - test if implementation 0046 * will not write tags to disabled namespaces 0047 * Description: make a custom settings container with one disabled and one 0048 * enabled namespace. Call setImageTagPaths. Read the result of both 0049 * namespaces 0050 * Results: The result of read from disabled namespace should be empty 0051 * The result of read from other namespace should be initial tag paths 0052 */ 0053 void testWriteToDisabledNamespaces(); 0054 0055 /** 0056 * @brief testReadFromDisabledNamespaces - test if disabled namespaces are ignored 0057 * Description: Write tagSet1 to first, disable namespace, write tagSet2 to second 0058 * enabled namespace 0059 * Results: The call of getImageTagsPaths should return tagSet2 0060 */ 0061 void testReadFromDisabledNamespaces(); 0062 }; 0063 0064 #endif // DIGIKAM_RATING_READ_WRITE_UTEST_H