fix: move test code to test project (#14)

This commit is contained in:
kegechen 2019-08-02 11:30:32 +08:00 committed by GitHub
parent 4123262258
commit 7dc310c8a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View File

@ -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<DGioFileInfo> fi = f->createFileInfo();
if (fi) {
qDebug() << fi->fileType() << fi->displayName() << fi->fileSize();
}
delete f;
}
qDebug() << "----------------------";
DGioMount * m = DGioMount::createFromPath("/media/wzc/_dde_data");

View File

@ -27,9 +27,10 @@ void DGioSimpleFileInfoTest::testCase_RegularFile()
QFileInfo tmpFileInfo(tmpFile);
QScopedPointer<DGioFile> file(DGioFile::createFromPath(tmpFileInfo.absoluteFilePath()));
QExplicitlySharedDataPointer<DGioFileInfo> fi = file->createFileInfo();
QCOMPARE(file->basename(), tmpFileInfo.fileName());
QCOMPARE(file->path(), tmpFileInfo.absoluteFilePath());
QCOMPARE(fi->fileSize(), tmpFileInfo.size());
}
QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest)