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 #include "detectexposure_utest.h" 0017 0018 // Qt includes 0019 0020 #include <QTest> 0021 #include <QStringList> 0022 #include <QDebug> 0023 0024 // Local includes 0025 0026 0027 using namespace Digikam; 0028 0029 QTEST_MAIN(ImgQSortTestDetecteExposure) 0030 0031 ImgQSortTestDetecteExposure::ImgQSortTestDetecteExposure(QObject* const parent) 0032 : ImgQSortTest(parent) 0033 { 0034 m_dataTestCases = dataTestCases; 0035 } 0036 0037 void ImgQSortTestDetecteExposure::testParseTestImagesForExposureDetection() 0038 { 0039 QHash<QString, bool> results = testParseTestImages(QLatin1String("exposureDetection"), 0040 ImgQSortTest_ParseTestImagesDefautDetection, DETECTEXPOSURE); 0041 0042 for (const auto& test_case : results.keys()) 0043 { 0044 QVERIFY(results.value(test_case)); 0045 } 0046 } 0047 0048 void ImgQSortTestDetecteExposure::testParseTestImagesForExposureDetection_backlight() 0049 { 0050 QHash<QString, bool> results = testParseTestImages(QLatin1String("exposureBacklight"), 0051 ImgQSortTest_ParseTestImagesDefautDetection, DETECTEXPOSURE); 0052 0053 for (const auto& test_case : results.keys()) 0054 { 0055 QVERIFY(results.value(test_case)); 0056 } 0057 } 0058 0059 void ImgQSortTestDetecteExposure::testParseTestImagesForExposureDetection_sun() 0060 { 0061 QHash<QString, bool> results = testParseTestImages(QLatin1String("exposureSun"), 0062 ImgQSortTest_ParseTestImagesDefautDetection, DETECTEXPOSURE); 0063 0064 for (const auto& test_case : results.keys()) 0065 { 0066 QVERIFY(results.value(test_case)); 0067 } 0068 } 0069 0070 #include "moc_detectexposure_utest.cpp"