From 7dc310c8a81f78727f1c3ec7d8be9d27e2a8dc25 Mon Sep 17 00:00:00 2001 From: kegechen Date: Fri, 2 Aug 2019 11:30:32 +0800 Subject: [PATCH] fix: move test code to test project (#14) --- qgio-tools/main.cpp | 10 ---------- test/tst_simplefileinfo.cpp | 3 ++- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/qgio-tools/main.cpp b/qgio-tools/main.cpp index c9271a2..07b03ed 100644 --- a/qgio-tools/main.cpp +++ b/qgio-tools/main.cpp @@ -94,16 +94,6 @@ int main(int argc, char * argv[]) delete f; } - f = DGioFile::createFromPath("/home/mike/Desktop/1.png"); - if (f) { - qDebug() << f->basename() << f->path() << f->uri(); - QExplicitlySharedDataPointer fi = f->createFileInfo(); - if (fi) { - qDebug() << fi->fileType() << fi->displayName() << fi->fileSize(); - } - delete f; - } - qDebug() << "----------------------"; DGioMount * m = DGioMount::createFromPath("/media/wzc/_dde_data"); diff --git a/test/tst_simplefileinfo.cpp b/test/tst_simplefileinfo.cpp index c2c85e8..14ac3e1 100644 --- a/test/tst_simplefileinfo.cpp +++ b/test/tst_simplefileinfo.cpp @@ -27,9 +27,10 @@ void DGioSimpleFileInfoTest::testCase_RegularFile() QFileInfo tmpFileInfo(tmpFile); QScopedPointer file(DGioFile::createFromPath(tmpFileInfo.absoluteFilePath())); - + QExplicitlySharedDataPointer fi = file->createFileInfo(); QCOMPARE(file->basename(), tmpFileInfo.fileName()); QCOMPARE(file->path(), tmpFileInfo.absoluteFilePath()); + QCOMPARE(fi->fileSize(), tmpFileInfo.size()); } QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest)