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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-06-09
0007  * Description : a test for the AdvancedRename utility
0008  *
0009  * SPDX-FileCopyrightText: 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_ADVANCED_RENAME_UTEST_H
0016 #define DIGIKAM_ADVANCED_RENAME_UTEST_H
0017 
0018 // Qt includes
0019 
0020 #include <QObject>
0021 
0022 // Local includes
0023 
0024 #include "advancedrenamemanager.h"
0025 #include "defaultrenameparser.h"
0026 #include "parsesettings.h"
0027 
0028 class AdvancedRenameTest : public QObject
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033 
0034     explicit AdvancedRenameTest(QObject* const parent = nullptr)
0035         : QObject(parent)
0036     {
0037     }
0038 
0039 private Q_SLOTS:
0040 
0041     /**
0042      * TOKEN TESTS
0043      */
0044     void testFileNameToken();
0045 
0046     void testFileExtensionToken();
0047     void testFileExtensionToken_data();
0048 
0049     void testFileOwnerToken();
0050 
0051     void testFileGroupToken();
0052 
0053     void testDirectoryNameToken();
0054     void testDirectoryNameToken_data();
0055 
0056     void testNumberToken();
0057     void testNumberToken_data();
0058 
0059     /**
0060      * MODIFIER TESTS
0061      */
0062 /*
0063     void testUniqueModifier();
0064 */
0065     void testReplaceModifier();
0066     void testReplaceModifier_data();
0067 
0068     void testRangeModifier();
0069     void testRangeModifier_data();
0070 
0071     void testDefaultValueModifier();
0072     void testDefaultValueModifier_data();
0073 
0074     void testUppercaseModifier();
0075 
0076     void testLowercaseModifier();
0077 
0078     void testFirstLetterOfEachWordUppercaseModifier_data();
0079     void testFirstLetterOfEachWordUppercaseModifier();
0080 
0081     void testChainedModifiers();
0082     void testChainedModifiers_data();
0083 
0084     void testUniqueModifier();
0085 
0086     /**
0087      * MANAGER TESTS
0088      */
0089     void addFiles_should_only_add_files();
0090     void addFiles_should_only_add_files2();
0091     void reset_removes_everything();
0092     void parseFiles_does_nothing_without_assigned_widget();
0093     void setStartIndex_invalid_index();
0094     void setStartIndex_sequencenumber_no_custom_start();
0095     void setStartIndex_sequencenumber_with_custom_start();
0096 
0097     void sequencenumber_tests_data();
0098     void sequencenumber_tests();
0099     void sequencenumber_tests_startIndex_data();
0100     void sequencenumber_tests_startIndex();
0101 
0102     void newFileList_tests_data();
0103     void newFileList_tests();
0104 
0105     void indexOfFile_sorting_data();
0106     void indexOfFile_sorting();
0107     void indexOfFile_invalid_input_returns_minus_one();
0108     void indexOfFolder_invalid_input_returns_minus_one();
0109     void indexOfFileGroup_invalid_input_returns_minus_one();
0110 
0111     void sortAction_custom_asc_should_not_sort();
0112     void sortAction_custom_desc_should_not_sort();
0113     void sortAction_name_asc();
0114     void sortAction_name_desc();
0115     void sortAction_size_asc();
0116     void sortAction_size_desc();
0117 /*
0118     void sortAction_date_asc();
0119     void sortAction_date_desc();
0120 */
0121 
0122     /**
0123      * OTHER TESTS
0124      */
0125     void testEmptyParseString();
0126 };
0127 
0128 #endif // DIGIKAM_ADVANCED_RENAME_UTEST_H