#include #include #include #include class DGioSimpleFileInfoTest : public QObject { Q_OBJECT public: DGioSimpleFileInfoTest(); private Q_SLOTS: void testCase_RegularFile(); }; DGioSimpleFileInfoTest::DGioSimpleFileInfoTest() { // } void DGioSimpleFileInfoTest::testCase_RegularFile() { QTemporaryFile tmpFile("test_RegularFile.txt"); QVERIFY(tmpFile.open()); 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()); QVERIFY(fi->themedIconNames().contains("text-plain")); // is this check okay? better approach? } QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest) #include "tst_simplefileinfo.moc"