File indexing completed on 2022-11-29 15:24:46

0001 /***********************************************************************
0002  * SPDX-FileCopyrightText: 2020 Shubham <aryan100jangid@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  ***********************************************************************/
0006 
0007 #include "testFileTree.h"
0008 
0009 TestFileTree::TestFileTree()
0010     : fl(std::make_unique<File>("./autotests/core/dummy.txt", 20))
0011 {
0012 }
0013 
0014 void TestFileTree::testFileName()
0015 {
0016     const QString fname = fl->displayName();
0017     QCOMPARE(QStringLiteral("./autotests/core/dummy.txt"), fname);
0018 }
0019 
0020 void TestFileTree::testFileSize()
0021 {
0022     const quint64 fsize = fl->size();
0023     QVERIFY(fsize > 0);
0024 }
0025 
0026 void TestFileTree::testFilePath()
0027 {
0028     auto folder = std::make_shared<Folder>("./autotests/core/");
0029     const QString fpath = fl->displayPath(folder);
0030     QVERIFY(!fpath.isEmpty());
0031 }
0032 
0033 QTEST_MAIN(TestFileTree)