forked from mirrors/gio-qt
fix: move test code to test project (#14)
This commit is contained in:
parent
4123262258
commit
7dc310c8a8
2 changed files with 2 additions and 11 deletions
|
@ -94,16 +94,6 @@ int main(int argc, char * argv[])
|
||||||
delete f;
|
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() << "----------------------";
|
qDebug() << "----------------------";
|
||||||
|
|
||||||
DGioMount * m = DGioMount::createFromPath("/media/wzc/_dde_data");
|
DGioMount * m = DGioMount::createFromPath("/media/wzc/_dde_data");
|
||||||
|
|
|
@ -27,9 +27,10 @@ void DGioSimpleFileInfoTest::testCase_RegularFile()
|
||||||
QFileInfo tmpFileInfo(tmpFile);
|
QFileInfo tmpFileInfo(tmpFile);
|
||||||
|
|
||||||
QScopedPointer<DGioFile> file(DGioFile::createFromPath(tmpFileInfo.absoluteFilePath()));
|
QScopedPointer<DGioFile> file(DGioFile::createFromPath(tmpFileInfo.absoluteFilePath()));
|
||||||
|
QExplicitlySharedDataPointer<DGioFileInfo> fi = file->createFileInfo();
|
||||||
QCOMPARE(file->basename(), tmpFileInfo.fileName());
|
QCOMPARE(file->basename(), tmpFileInfo.fileName());
|
||||||
QCOMPARE(file->path(), tmpFileInfo.absoluteFilePath());
|
QCOMPARE(file->path(), tmpFileInfo.absoluteFilePath());
|
||||||
|
QCOMPARE(fi->fileSize(), tmpFileInfo.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest)
|
QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest)
|
||||||
|
|
Loading…
Reference in a new issue