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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 28/08/2021
0007  * Description : an unit-test to detect image quality level
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2021-2022 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_DETECT_COMPRESSION_UTEST_H
0017 #define DIGIKAM_DETECT_COMPRESSION_UTEST_H
0018 
0019 // Qt includes
0020 
0021 #include <QObject>
0022 #include <QString>
0023 
0024 // Local includes
0025 
0026 #include "imgqsorttest.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class ImgQSortTestDetectCompression : public ImgQSortTest
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036 
0037     explicit ImgQSortTestDetectCompression(QObject* const parent = nullptr);
0038 
0039 private Q_SLOTS:
0040 
0041     void testParseTestImagesForCompressionDetection();
0042     void testParseTestImagesForCompressionDetection_failCase();
0043 };
0044 
0045 DataTestCases const dataTestCases =
0046 {
0047     {QLatin1String("compressionDetection"),          PairImageQuality(QLatin1String("test_compressed_2.jpg"), 2)},
0048     {QLatin1String("compressionDetection"),          PairImageQuality(QLatin1String("test_compressed_4.jpg"), 2)},
0049     {QLatin1String("compressionDetection"),          PairImageQuality(QLatin1String("test_compressed_9.jpg"), 3)},
0050 
0051     {QLatin1String("compressionDetection_failCase"), PairImageQuality(QLatin1String("test_compressed_1.jpg"), 1)}, //False case : Pending instead of Accepted
0052 };
0053 
0054 } // namespace Digikam
0055 
0056 #endif // DIGIKAM_DETECT_COMPRESSION_UTEST_H