1 /***********************************************************************
2 * SPDX-FileCopyrightText: 2020 Shubham <aryan100jangid@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5 ***********************************************************************/
6 
7 #include "testFileTree.h"
8 
TestFileTree()9 TestFileTree::TestFileTree()
10 {
11     fl = new File("./autotests/core/dummy.txt", 20);
12 }
13 
~TestFileTree()14 TestFileTree::~TestFileTree()
15 {
16     delete fl;
17 }
18 
testFileName()19 void TestFileTree::testFileName()
20 {
21     const QString fname = fl->displayName();
22     QCOMPARE(QStringLiteral("./autotests/core/dummy.txt"), fname);
23 }
24 
testFileSize()25 void TestFileTree::testFileSize()
26 {
27     const quint64 fsize = fl->size();
28     QVERIFY(fsize > 0);
29 }
30 
testFilePath()31 void TestFileTree::testFilePath()
32 {
33     const Folder *folder = new Folder("./autotests/core/");
34     const QString fpath = fl->displayPath(folder);
35     QVERIFY(!fpath.isEmpty());
36 }
37 
38 QTEST_MAIN(TestFileTree)
39