mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
remove tests related to resources (QRC)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
78389dee45
commit
1d20035a5b
19 changed files with 8 additions and 225 deletions
|
@ -1,4 +1,3 @@
|
|||
katie_test(tst_qdir
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tst_qdir.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qdir.qrc
|
||||
)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/tst_qdir/">
|
||||
<file>resources/entryList/</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -297,11 +297,9 @@ void tst_QDir::exists_data()
|
|||
QTest::newRow("data0") << QDir::currentPath() << true;
|
||||
QTest::newRow("data0.1") << QDir::currentPath() + "/" << true;
|
||||
QTest::newRow("data1") << QString("/I/Do_not_expect_this_path_to_exist/") << false;
|
||||
QTest::newRow("resource0") << QString(":/tst_qdir/") << true;
|
||||
QTest::newRow("resource1") << QString(":/I/Do_not_expect_this_resource_to_exist/") << false;
|
||||
|
||||
QTest::newRow("simple dir") << SRCDIR "resources" << true;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << true;
|
||||
QTest::newRow("simple dir") << SRCDIR "testdir" << true;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "testdir/" << true;
|
||||
}
|
||||
|
||||
void tst_QDir::exists()
|
||||
|
@ -321,9 +319,6 @@ void tst_QDir::isRelativePath_data()
|
|||
QTest::newRow("data0") << "../somedir" << true;
|
||||
QTest::newRow("data2") << "somedir" << true;
|
||||
QTest::newRow("data3") << "/somedir" << false;
|
||||
|
||||
QTest::newRow("resource0") << ":/prefix" << false;
|
||||
QTest::newRow("resource1") << ":/prefix/foo.bar" << false;
|
||||
}
|
||||
|
||||
void tst_QDir::isRelativePath()
|
||||
|
@ -402,13 +397,6 @@ void tst_QDir::entryList_data()
|
|||
// QTest::newRow("unprintablenames") << SRCDIR "unprintablenames" << QStringList("*")
|
||||
// << (int)(QDir::NoFilter) << (int)(QDir::NoSort)
|
||||
// << QString(".,..").split(",");
|
||||
QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
|
||||
<< (int)(QDir::NoFilter) << (int)(QDir::NoSort)
|
||||
<< QString("file1.data,file2.data,file3.data").split(',');
|
||||
QTest::newRow("resources2") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
|
||||
<< (int)(QDir::Files) << (int)(QDir::NoSort)
|
||||
<< QString("file1.data,file2.data,file3.data").split(',');
|
||||
|
||||
QTest::newRow("nofilter") << SRCDIR "entrylist/" << QStringList("*")
|
||||
<< int(QDir::NoFilter) << int(QDir::Name)
|
||||
<< filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','));
|
||||
|
@ -579,8 +567,8 @@ void tst_QDir::entryListSimple_data()
|
|||
QTest::addColumn<int>("countMin");
|
||||
|
||||
QTest::newRow("data2") << "do_not_expect_this_path_to_exist/" << 0;
|
||||
QTest::newRow("simple dir") << SRCDIR "resources" << 2;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << 2;
|
||||
QTest::newRow("simple dir") << SRCDIR "testdir" << 2;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "testdir/" << 2;
|
||||
}
|
||||
|
||||
void tst_QDir::entryListSimple()
|
||||
|
@ -659,8 +647,6 @@ void tst_QDir::canonicalPath_data()
|
|||
QTest::newRow("rootPath + ./") << QDir::rootPath().append("./") << QDir::rootPath();
|
||||
|
||||
QTest::newRow("rootPath + ../.. ") << QDir::rootPath().append("../..") << QDir::rootPath();
|
||||
|
||||
QTest::newRow("resource") << ":/tst_qdir/resources/entryList" << ":/tst_qdir/resources/entryList";
|
||||
}
|
||||
|
||||
void tst_QDir::canonicalPath()
|
||||
|
@ -781,8 +767,6 @@ void tst_QDir::setNameFilters_data()
|
|||
<< QString("foo. bar,foo.bar").split(",");
|
||||
QTest::newRow("files1") << appPath + "testdir/dir" << QString("*r.cpp *.pro").split(" ")
|
||||
<< QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(",");
|
||||
QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
|
||||
<< QString("file1.data,file2.data,file3.data").split(',');
|
||||
}
|
||||
|
||||
void tst_QDir::setNameFilters()
|
||||
|
@ -820,14 +804,10 @@ tst_QDir::cleanPath_data()
|
|||
QTest::newRow("data8") << "/foo/bar/..//file1.txt" << "/foo/file1.txt";
|
||||
QTest::newRow("data9") << "//" << "/";
|
||||
QTest::newRow("data10") << "/:/" << "/:";
|
||||
|
||||
QTest::newRow("resource0") << ":/prefix/foo.bar" << ":/prefix/foo.bar";
|
||||
QTest::newRow("resource1") << "://prefix/..//prefix/foo.bar" << ":/prefix/foo.bar";
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tst_QDir::cleanPath()
|
||||
void tst_QDir::cleanPath()
|
||||
{
|
||||
QFETCH(QString, path);
|
||||
QFETCH(QString, expected);
|
||||
|
@ -846,7 +826,6 @@ void tst_QDir::absoluteFilePath_data()
|
|||
QTest::newRow("2") << "/" << "passwd" << "/passwd";
|
||||
QTest::newRow("3") << "relative" << "path" << QDir::currentPath() + "/relative/path";
|
||||
QTest::newRow("4") << "" << "" << QDir::currentPath();
|
||||
QTest::newRow("resource") << ":/prefix" << "foo.bar" << ":/prefix/foo.bar";
|
||||
}
|
||||
|
||||
void tst_QDir::absoluteFilePath()
|
||||
|
@ -871,7 +850,6 @@ void tst_QDir::absolutePath_data()
|
|||
QTest::newRow("/system/data/../config") << QDir::rootPath() + "system/data/../config" << QDir::rootPath() + "system/config";
|
||||
QTest::newRow("//home//qt/") << QDir::rootPath() + "/home//qt/" << QDir::rootPath() + "home/qt";
|
||||
QTest::newRow("foo/../bar") << "foo/../bar" << QDir::currentPath() + "/bar";
|
||||
QTest::newRow("resource") << ":/prefix/foo.bar" << ":/prefix/foo.bar";
|
||||
}
|
||||
|
||||
void tst_QDir::absolutePath()
|
||||
|
@ -904,9 +882,6 @@ void tst_QDir::relativeFilePath_data()
|
|||
QTest::newRow("10") << "/" << "/ding/../../../../dong" << "../../../dong";
|
||||
|
||||
QTest::newRow("11") << "" << "" << "";
|
||||
|
||||
QTest::newRow("resource0") << ":/prefix" << "foo.bar" << "foo.bar";
|
||||
QTest::newRow("resource1") << ":/prefix" << ":/prefix/foo.bar" << "foo.bar";
|
||||
}
|
||||
|
||||
void tst_QDir::relativeFilePath()
|
||||
|
@ -929,7 +904,6 @@ void tst_QDir::filePath_data()
|
|||
QTest::newRow("2") << "/" << "passwd" << "/passwd";
|
||||
QTest::newRow("3") << "relative" << "path" << "relative/path";
|
||||
QTest::newRow("4") << "" << "" << ".";
|
||||
QTest::newRow("resource") << ":/prefix" << "foo.bar" << ":/prefix/foo.bar";
|
||||
}
|
||||
|
||||
void tst_QDir::filePath()
|
||||
|
@ -989,8 +963,6 @@ void tst_QDir::exists2_data()
|
|||
QTest::newRow("4") << "/testData" << false;
|
||||
QTest::newRow("5") << "tst_qdir.cpp" << true;
|
||||
QTest::newRow("6") << "/resources.cpp" << false;
|
||||
QTest::newRow("resource0") << ":/prefix/foo.bar" << false;
|
||||
QTest::newRow("resource1") << ":/tst_qdir/resources/entryList/file1.data" << true;
|
||||
}
|
||||
|
||||
void tst_QDir::exists2()
|
||||
|
@ -1022,8 +994,6 @@ void tst_QDir::dirName_data()
|
|||
QTest::newRow("slash0") << "c:/winnt/system32" << "system32";
|
||||
QTest::newRow("slash1") << "/winnt/system32" << "system32";
|
||||
QTest::newRow("slash2") << "c:/winnt/system32/kernel32.dll" << "kernel32.dll";
|
||||
|
||||
QTest::newRow("resource") << ":/prefix" << "prefix";
|
||||
}
|
||||
|
||||
void tst_QDir::dirName()
|
||||
|
@ -1351,9 +1321,6 @@ void tst_QDir::isRoot_data()
|
|||
|
||||
test = QDir(QDir::rootPath().append("./")).canonicalPath();
|
||||
QTest::newRow(QString("canonicalPath " + test).toLatin1()) << test << true;
|
||||
|
||||
QTest::newRow("resources root") << ":/" << true;
|
||||
QTest::newRow("resources nonroot") << ":/entrylist" << false;
|
||||
}
|
||||
|
||||
void tst_QDir::isRoot()
|
||||
|
@ -1492,8 +1459,6 @@ void tst_QDir::isRelative_data()
|
|||
QTest::newRow("homepath") << QDir::homePath() << false;
|
||||
QTest::newRow("temppath") << QDir::tempPath() << false;
|
||||
QTest::newRow("rootpath") << QDir::rootPath() << false;
|
||||
|
||||
QTest::newRow("resource") << ":/prefix" << false;
|
||||
}
|
||||
|
||||
void tst_QDir::isRelative()
|
||||
|
@ -1522,4 +1487,3 @@ void tst_QDir::isReadable()
|
|||
QTEST_MAIN(tst_QDir)
|
||||
|
||||
#include "moc_tst_qdir.cpp"
|
||||
#include "qrc_qdir.cpp"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
katie_test(tst_qdiriterator
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tst_qdiriterator.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qdiriterator.qrc
|
||||
)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>entrylist/file</file>
|
||||
<file>entrylist/directory/dummy</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -84,8 +84,6 @@ private: // convenience functions
|
|||
private slots:
|
||||
void iterateRelativeDirectory_data();
|
||||
void iterateRelativeDirectory();
|
||||
void iterateResource_data();
|
||||
void iterateResource();
|
||||
void stopLinkLoop();
|
||||
void absoluteFilePathsFromRelativeIteratorPath();
|
||||
void recurseWithFilters() const;
|
||||
|
@ -320,53 +318,6 @@ void tst_QDirIterator::iterateRelativeDirectory()
|
|||
QCOMPARE(list, sortedEntries);
|
||||
}
|
||||
|
||||
void tst_QDirIterator::iterateResource_data()
|
||||
{
|
||||
QTest::addColumn<QString>("dirName"); // relative from current path or abs
|
||||
QTest::addColumn<QDirIterator::IteratorFlags>("flags");
|
||||
QTest::addColumn<QDir::Filters>("filters");
|
||||
QTest::addColumn<QStringList>("nameFilters");
|
||||
QTest::addColumn<QStringList>("entries");
|
||||
|
||||
QTest::newRow("invalid") << QString::fromLatin1(":/burpaburpa") << QDirIterator::IteratorFlags(0)
|
||||
<< QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*"))
|
||||
<< QStringList();
|
||||
QTest::newRow(":/") << QString::fromLatin1(":/") << QDirIterator::IteratorFlags(0)
|
||||
<< QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*"))
|
||||
<< QString::fromLatin1(":/entrylist").split(QLatin1String(","));
|
||||
QTest::newRow(":/entrylist") << QString::fromLatin1(":/entrylist") << QDirIterator::IteratorFlags(0)
|
||||
<< QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*"))
|
||||
<< QString::fromLatin1(":/entrylist/directory,:/entrylist/file").split(QLatin1String(","));
|
||||
QTest::newRow(":/ recursive") << QString::fromLatin1(":/") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories)
|
||||
<< QDir::Filters(QDir::NoFilter) << QStringList(QLatin1String("*"))
|
||||
<< QString::fromLatin1(":/entrylist,:/entrylist/directory,:/entrylist/directory/dummy,:/entrylist/file").split(QLatin1String(","));
|
||||
}
|
||||
|
||||
void tst_QDirIterator::iterateResource()
|
||||
{
|
||||
QFETCH(QString, dirName);
|
||||
QFETCH(QDirIterator::IteratorFlags, flags);
|
||||
QFETCH(QDir::Filters, filters);
|
||||
QFETCH(QStringList, nameFilters);
|
||||
QFETCH(QStringList, entries);
|
||||
|
||||
QDirIterator it(dirName, nameFilters, filters, flags);
|
||||
QStringList list;
|
||||
while (it.hasNext())
|
||||
list << it.next();
|
||||
|
||||
list.sort();
|
||||
QStringList sortedEntries = entries;
|
||||
sortedEntries.sort();
|
||||
|
||||
if (sortedEntries != list) {
|
||||
qDebug() << "EXPECTED:" << sortedEntries;
|
||||
qDebug() << "ACTUAL:" << list;
|
||||
}
|
||||
|
||||
QCOMPARE(list, sortedEntries);
|
||||
}
|
||||
|
||||
void tst_QDirIterator::stopLinkLoop()
|
||||
{
|
||||
createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk");
|
||||
|
@ -515,4 +466,3 @@ void tst_QDirIterator::qtbug15421_hiddenDirs_hiddenFiles()
|
|||
QTEST_MAIN(tst_QDirIterator)
|
||||
|
||||
#include "moc_tst_qdiriterator.cpp"
|
||||
#include "qrc_qdiriterator.cpp"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
katie_test(tst_qfile
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tst_qfile.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/copy-rename.qrc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qfile.qrc
|
||||
)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>copy-rename.qrc</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -1,5 +0,0 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/tst_qfileinfo/">
|
||||
<file>resources/</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -1 +0,0 @@
|
|||
12345
|
|
@ -135,7 +135,6 @@ private slots:
|
|||
void rename_data();
|
||||
void rename();
|
||||
void renameWithAtEndSpecialFile() const;
|
||||
void resourceCopyRename();
|
||||
void renameMultiple();
|
||||
void appendAndRead();
|
||||
void standarderror();
|
||||
|
@ -147,8 +146,6 @@ private slots:
|
|||
|
||||
void map_data();
|
||||
void map();
|
||||
void mapResource_data();
|
||||
void mapResource();
|
||||
void mapOpenMode_data();
|
||||
void mapOpenMode();
|
||||
|
||||
|
@ -276,8 +273,6 @@ tst_QFile::tst_QFile()
|
|||
: m_srcDir(QLatin1String(SRCDIR))
|
||||
, m_stdinProcess(findStdinProcess())
|
||||
{
|
||||
Q_INIT_RESOURCE(copy_rename);
|
||||
Q_INIT_RESOURCE(qfile);
|
||||
}
|
||||
|
||||
tst_QFile::~tst_QFile()
|
||||
|
@ -298,10 +293,6 @@ void tst_QFile::cleanup()
|
|||
// TODO: Add cleanup code here.
|
||||
// This will be executed immediately after each test is run.
|
||||
|
||||
// for resourceCopyRename()
|
||||
QFile::remove("file-copy-destination.txt");
|
||||
QFile::remove("file-rename-destination.txt");
|
||||
|
||||
// for copyAfterFail()
|
||||
QFile::remove("file-to-be-copied.txt");
|
||||
QFile::remove("existing-file.txt");
|
||||
|
@ -366,7 +357,6 @@ void tst_QFile::cleanupTestCase()
|
|||
QFile::remove("tst_qfile_copy.cpp");
|
||||
QFile::remove("nullinline.txt");
|
||||
QFile::remove("myLink2.lnk");
|
||||
QFile::remove("resources");
|
||||
QFile::remove("qfile_map_testfile");
|
||||
QFile::remove("readAllBuffer.txt");
|
||||
QFile::remove("qt_file.tmp");
|
||||
|
@ -1088,9 +1078,6 @@ void tst_QFile::permissions_data()
|
|||
QTest::newRow("data0") << QCoreApplication::instance()->applicationFilePath() << uint(QFile::ExeUser) << true;
|
||||
QTest::newRow("data1") << SRCDIR "tst_qfile.cpp" << uint(QFile::ReadUser) << true;
|
||||
// QTest::newRow("data2") << "tst_qfile.cpp" << int(QFile::WriteUser) << false;
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::ReadUser) << true;
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::WriteUser) << false;
|
||||
QTest::newRow("resource3") << ":/tst_qfileinfo/resources/file1.ext1" << uint(QFile::ExeUser) << false;
|
||||
}
|
||||
|
||||
void tst_QFile::permissions()
|
||||
|
@ -2141,22 +2128,6 @@ void tst_QFile::renameWithAtEndSpecialFile() const
|
|||
QVERIFY(QFile::rename(newName, originalName));
|
||||
}
|
||||
|
||||
void tst_QFile::resourceCopyRename()
|
||||
{
|
||||
// Using a resource file as a *read-only* source whose move and copy should fail.
|
||||
QFile file(":/copy-rename.qrc");
|
||||
QVERIFY(file.exists());
|
||||
QFile::remove("file-rename-destination.txt");
|
||||
|
||||
QVERIFY(!file.copy("file-copy-destination.txt"));
|
||||
QVERIFY(!QFile::exists("file-copy-destination.txt"));
|
||||
QVERIFY(!file.isOpen());
|
||||
|
||||
QVERIFY(!file.rename("file-rename-destination.txt"));
|
||||
QVERIFY(!QFile::exists("file-rename-destination.txt"));
|
||||
QVERIFY(!file.isOpen());
|
||||
}
|
||||
|
||||
void tst_QFile::renameMultiple()
|
||||
{
|
||||
// create the file if it doesn't exist
|
||||
|
@ -2550,43 +2521,6 @@ void tst_QFile::map()
|
|||
QVERIFY(file.remove());
|
||||
}
|
||||
|
||||
void tst_QFile::mapResource_data()
|
||||
{
|
||||
QTest::addColumn<int>("offset");
|
||||
QTest::addColumn<int>("size");
|
||||
QTest::addColumn<QFile::FileError>("error");
|
||||
QTest::addColumn<QString>("fileName");
|
||||
|
||||
QString validFile = ":/tst_qfileinfo/resources/file1.ext1";
|
||||
QString invalidFile = ":/tst_qfileinfo/resources/filefoo.ext1";
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
QString file = (i == 0) ? validFile : invalidFile;
|
||||
QTest::newRow("0, 0") << 0 << 0 << QFile::UnspecifiedError << file;
|
||||
QTest::newRow("0, BIG") << 0 << 4096 << QFile::UnspecifiedError << file;
|
||||
QTest::newRow("-1, 0") << -1 << 0 << QFile::UnspecifiedError << file;
|
||||
QTest::newRow("0, -1") << 0 << -1 << QFile::UnspecifiedError << file;
|
||||
}
|
||||
|
||||
QTest::newRow("0, 1") << 0 << 1 << QFile::NoError << validFile;
|
||||
}
|
||||
|
||||
void tst_QFile::mapResource()
|
||||
{
|
||||
QFETCH(QString, fileName);
|
||||
QFETCH(int, offset);
|
||||
QFETCH(int, size);
|
||||
QFETCH(QFile::FileError, error);
|
||||
|
||||
QFile file(fileName);
|
||||
uchar *memory = file.map(offset, size);
|
||||
QCOMPARE(file.error(), error);
|
||||
QVERIFY((error == QFile::NoError) ? (memory != 0) : (memory == 0));
|
||||
if (error == QFile::NoError)
|
||||
QCOMPARE(QString(memory[0]), QString::number(offset + 1));
|
||||
QVERIFY(file.unmap(memory));
|
||||
}
|
||||
|
||||
void tst_QFile::mapOpenMode_data()
|
||||
{
|
||||
QTest::addColumn<int>("openMode");
|
||||
|
@ -2643,7 +2577,7 @@ void tst_QFile::mapOpenMode()
|
|||
|
||||
void tst_QFile::openDirectory()
|
||||
{
|
||||
QFile f1(SRCDIR "resources");
|
||||
QFile f1(SRCDIR);
|
||||
// it's a directory, it must not exist
|
||||
QVERIFY(!f1.exists());
|
||||
|
||||
|
@ -2891,6 +2825,4 @@ void tst_QFile::hijack()
|
|||
|
||||
QTEST_MAIN(tst_QFile)
|
||||
|
||||
#include "qrc_copy-rename.cpp"
|
||||
#include "qrc_qfile.cpp"
|
||||
#include "moc_tst_qfile.cpp"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
katie_test(tst_qfileinfo
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tst_qfileinfo.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qfileinfo.qrc
|
||||
)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/tst_qfileinfo/">
|
||||
<file>resources/</file>
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -217,9 +217,6 @@ void tst_QFileInfo::isFile_data()
|
|||
|
||||
QTest::newRow("data0") << QDir::currentPath() << false;
|
||||
QTest::newRow("data1") << SRCDIR "tst_qfileinfo.cpp" << true;
|
||||
QTest::newRow("data2") << ":/tst_qfileinfo/resources/" << false;
|
||||
QTest::newRow("data3") << ":/tst_qfileinfo/resources/file1" << true;
|
||||
QTest::newRow("data4") << ":/tst_qfileinfo/resources/afilethatshouldnotexist" << false;
|
||||
}
|
||||
|
||||
void tst_QFileInfo::isFile()
|
||||
|
@ -250,9 +247,6 @@ void tst_QFileInfo::isDir_data()
|
|||
|
||||
QTest::newRow("data0") << QDir::currentPath() << true;
|
||||
QTest::newRow("data1") << SRCDIR "tst_qfileinfo.cpp" << false;
|
||||
QTest::newRow("data2") << ":/tst_qfileinfo/resources/" << true;
|
||||
QTest::newRow("data3") << ":/tst_qfileinfo/resources/file1" << false;
|
||||
QTest::newRow("data4") << ":/tst_qfileinfo/resources/afilethatshouldnotexist" << false;
|
||||
|
||||
QTest::newRow("simple dir") << SRCDIR "resources" << true;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << true;
|
||||
|
@ -277,8 +271,6 @@ void tst_QFileInfo::isRoot_data()
|
|||
QTest::newRow("data1") << "/" << true;
|
||||
QTest::newRow("data2") << "*" << false;
|
||||
QTest::newRow("data3") << "/*" << false;
|
||||
QTest::newRow("data4") << ":/tst_qfileinfo/resources/" << false;
|
||||
QTest::newRow("data5") << ":/" << true;
|
||||
|
||||
QTest::newRow("simple dir") << SRCDIR "resources" << false;
|
||||
QTest::newRow("simple dir with slash") << SRCDIR "resources/" << false;
|
||||
|
@ -301,9 +293,6 @@ void tst_QFileInfo::exists_data()
|
|||
QTest::newRow("data0") << QDir::currentPath() << true;
|
||||
QTest::newRow("data1") << SRCDIR "tst_qfileinfo.cpp" << true;
|
||||
QTest::newRow("data2") << "/I/do_not_expect_this_path_to_exist/" << false;
|
||||
QTest::newRow("data3") << ":/tst_qfileinfo/resources/" << true;
|
||||
QTest::newRow("data4") << ":/tst_qfileinfo/resources/file1" << true;
|
||||
QTest::newRow("data5") << ":/I/do_not_expect_this_path_to_exist/" << false;
|
||||
QTest::newRow("data6") << SRCDIR "resources/*" << false;
|
||||
QTest::newRow("data7") << SRCDIR "resources/*.foo" << false;
|
||||
QTest::newRow("data8") << SRCDIR "resources/*.ext1" << false;
|
||||
|
@ -464,8 +453,6 @@ void tst_QFileInfo::fileName_data()
|
|||
QTest::newRow("relativeFile") << "tmp.txt" << "tmp.txt";
|
||||
QTest::newRow("relativeFileInSubDir") << "temp/tmp.txt" << "tmp.txt";
|
||||
QTest::newRow("absFilePath") << "/home/andy/tmp.txt" << "tmp.txt";
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << "file1.ext1";
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << "file1.ext1.ext2";
|
||||
|
||||
QTest::newRow("ending slash [small]") << QString::fromLatin1("/a/") << QString::fromLatin1("");
|
||||
QTest::newRow("no ending slash [small]") << QString::fromLatin1("/a") << QString::fromLatin1("a");
|
||||
|
@ -495,7 +482,6 @@ void tst_QFileInfo::dir_data()
|
|||
QTest::newRow("relativeFileInSubDirAbsPath") << "temp/tmp.txt" << true << QDir::currentPath() + "/temp";
|
||||
QTest::newRow("absFilePath") << QDir::currentPath() + "/tmp.txt" << false << QDir::currentPath();
|
||||
QTest::newRow("absFilePathAbsPath") << QDir::currentPath() + "/tmp.txt" << true << QDir::currentPath();
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << true << ":/tst_qfileinfo/resources";
|
||||
}
|
||||
|
||||
void tst_QFileInfo::dir()
|
||||
|
@ -526,8 +512,6 @@ void tst_QFileInfo::suffix_data()
|
|||
QTest::newRow("data1") << "file.tar.gz" << "gz";
|
||||
QTest::newRow("data2") << "/path/file/file.tar.gz" << "gz";
|
||||
QTest::newRow("data3") << "/path/file.tar" << "tar";
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << "ext1";
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << "ext2";
|
||||
QTest::newRow("hidden1") << ".ext1" << "ext1";
|
||||
QTest::newRow("hidden1") << ".ext" << "ext";
|
||||
QTest::newRow("hidden1") << ".ex" << "ex";
|
||||
|
@ -560,8 +544,6 @@ void tst_QFileInfo::completeSuffix_data()
|
|||
QTest::newRow("data1") << "file.tar.gz" << "tar.gz";
|
||||
QTest::newRow("data2") << "/path/file/file.tar.gz" << "tar.gz";
|
||||
QTest::newRow("data3") << "/path/file.tar" << "tar";
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << "ext1";
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << "ext1.ext2";
|
||||
}
|
||||
|
||||
void tst_QFileInfo::completeSuffix()
|
||||
|
@ -583,8 +565,6 @@ void tst_QFileInfo::baseName_data()
|
|||
QTest::newRow("data2") << "/path/file/file.tar.gz" << "file";
|
||||
QTest::newRow("data3") << "/path/file.tar" << "file";
|
||||
QTest::newRow("data4") << "/path/file" << "file";
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << "file1";
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << "file1";
|
||||
}
|
||||
|
||||
void tst_QFileInfo::baseName()
|
||||
|
@ -606,8 +586,6 @@ void tst_QFileInfo::completeBaseName_data()
|
|||
QTest::newRow("data2") << "/path/file/file.tar.gz" << "file.tar";
|
||||
QTest::newRow("data3") << "/path/file.tar" << "file";
|
||||
QTest::newRow("data4") << "/path/file" << "file";
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << "file1";
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << "file1.ext1";
|
||||
}
|
||||
|
||||
void tst_QFileInfo::completeBaseName()
|
||||
|
@ -628,9 +606,6 @@ void tst_QFileInfo::permission_data()
|
|||
QTest::newRow("data0") << QCoreApplication::instance()->applicationFilePath() << int(QFile::ExeUser) << true;
|
||||
QTest::newRow("data1") << SRCDIR "tst_qfileinfo.cpp" << int(QFile::ReadUser) << true;
|
||||
// QTest::newRow("data2") << "tst_qfileinfo.cpp" << int(QFile::WriteUser) << false;
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << int(QFile::ReadUser) << true;
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1" << int(QFile::WriteUser) << false;
|
||||
QTest::newRow("resource3") << ":/tst_qfileinfo/resources/file1.ext1" << int(QFile::ExeUser) << false;
|
||||
}
|
||||
|
||||
void tst_QFileInfo::permission()
|
||||
|
@ -647,14 +622,11 @@ void tst_QFileInfo::size_data()
|
|||
QTest::addColumn<QString>("file");
|
||||
QTest::addColumn<int>("size");
|
||||
|
||||
QTest::newRow("resource1") << ":/tst_qfileinfo/resources/file1.ext1" << 0;
|
||||
QFile::remove("file1");
|
||||
QFile file("file1");
|
||||
QVERIFY(file.open(QFile::WriteOnly));
|
||||
QCOMPARE(file.write("JAJAJAA"), qint64(7));
|
||||
QTest::newRow("created-file") << "file1" << 7;
|
||||
|
||||
QTest::newRow("resource2") << ":/tst_qfileinfo/resources/file1.ext1.ext2" << 0;
|
||||
}
|
||||
|
||||
void tst_QFileInfo::size()
|
||||
|
@ -848,8 +820,6 @@ void tst_QFileInfo::isLocalFs_data()
|
|||
|
||||
QTest::newRow("local root") << QString::fromLatin1("/") << true;
|
||||
QTest::newRow("local non-existent file") << QString::fromLatin1("/abrakadabra.boo") << true;
|
||||
|
||||
QTest::newRow("qresource root") << QString::fromLatin1(":/") << false;
|
||||
}
|
||||
|
||||
void tst_QFileInfo::isLocalFs()
|
||||
|
@ -1114,5 +1084,4 @@ void tst_QFileInfo::invalidState()
|
|||
|
||||
QTEST_MAIN(tst_QFileInfo)
|
||||
|
||||
#include "moc_tst_qfileinfo.cpp"
|
||||
#include "qrc_qfileinfo.cpp"
|
||||
#include "moc_tst_qfileinfo.cpp"
|
|
@ -1911,7 +1911,7 @@ void tst_QTextDocument::clonePreservesDefaultFont()
|
|||
|
||||
void tst_QTextDocument::clonePreservesResources()
|
||||
{
|
||||
QUrl testUrl(":/foobar");
|
||||
QUrl testUrl("/foobar");
|
||||
QVariant testResource("hello world");
|
||||
|
||||
doc->addResource(QTextDocument::ImageResource, testUrl, testResource);
|
||||
|
|
Loading…
Add table
Reference in a new issue