mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kio: testing build fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e5be0d5a2a
commit
2eda09625a
3 changed files with 7 additions and 42 deletions
|
@ -1018,11 +1018,8 @@ void JobTest::deleteDirectory()
|
|||
QVERIFY(!QFile::exists(dest));
|
||||
}
|
||||
|
||||
void JobTest::deleteSymlink(bool using_fast_path)
|
||||
void JobTest::deleteSymlink()
|
||||
{
|
||||
extern KIO_EXPORT bool kio_resolve_local_urls;
|
||||
kio_resolve_local_urls = !using_fast_path;
|
||||
|
||||
const QString src = homeTmpDir() + "dirFromHome";
|
||||
createTestDirectory(src);
|
||||
QVERIFY(QDir(src).exists());
|
||||
|
@ -1039,22 +1036,10 @@ void JobTest::deleteSymlink(bool using_fast_path)
|
|||
QVERIFY(ok);
|
||||
QVERIFY(!QDir(dest).exists());
|
||||
QVERIFY(QDir(src).exists());
|
||||
|
||||
kio_resolve_local_urls = true;
|
||||
}
|
||||
|
||||
|
||||
void JobTest::deleteSymlink()
|
||||
void JobTest::deleteManyDirs()
|
||||
{
|
||||
deleteSymlink(true);
|
||||
deleteSymlink(false);
|
||||
}
|
||||
|
||||
void JobTest::deleteManyDirs(bool using_fast_path)
|
||||
{
|
||||
extern KIO_EXPORT bool kio_resolve_local_urls;
|
||||
kio_resolve_local_urls = !using_fast_path;
|
||||
|
||||
const int numDirs = 50;
|
||||
KUrl::List dirs;
|
||||
for (int i = 0; i < numDirs; ++i) {
|
||||
|
@ -1073,13 +1058,6 @@ void JobTest::deleteManyDirs(bool using_fast_path)
|
|||
}
|
||||
|
||||
kDebug() << "Deleted" << numDirs << "dirs in" << dt.elapsed() << "milliseconds";
|
||||
kio_resolve_local_urls = true;
|
||||
}
|
||||
|
||||
void JobTest::deleteManyDirs()
|
||||
{
|
||||
deleteManyDirs(true);
|
||||
deleteManyDirs(false);
|
||||
}
|
||||
|
||||
static void createManyFiles(const QString& baseDir, int numFiles)
|
||||
|
@ -1112,11 +1090,8 @@ void JobTest::deleteManyFilesIndependently()
|
|||
kDebug() << "Deleted" << numFiles << "files in" << dt.elapsed() << "milliseconds";
|
||||
}
|
||||
|
||||
void JobTest::deleteManyFilesTogether(bool using_fast_path)
|
||||
void JobTest::deleteManyFilesTogether()
|
||||
{
|
||||
extern KIO_EXPORT bool kio_resolve_local_urls;
|
||||
kio_resolve_local_urls = !using_fast_path;
|
||||
|
||||
QElapsedTimer dt;
|
||||
dt.start();
|
||||
const int numFiles = 100; // Use 1000 for performance testing
|
||||
|
@ -1135,14 +1110,6 @@ void JobTest::deleteManyFilesTogether(bool using_fast_path)
|
|||
bool ok = KIO::NetAccess::synchronousRun(job, 0);
|
||||
QVERIFY(ok);
|
||||
kDebug() << "Deleted" << numFiles << "files in" << dt.elapsed() << "milliseconds";
|
||||
|
||||
kio_resolve_local_urls = true;
|
||||
}
|
||||
|
||||
void JobTest::deleteManyFilesTogether()
|
||||
{
|
||||
deleteManyFilesTogether(true);
|
||||
deleteManyFilesTogether(false);
|
||||
}
|
||||
|
||||
void JobTest::rmdirEmpty()
|
||||
|
|
|
@ -94,10 +94,6 @@ private:
|
|||
void copyLocalDirectory( const QString& src, const QString& dest, int flags = 0 );
|
||||
void moveLocalFile( const QString& src, const QString& dest );
|
||||
void moveLocalDirectory( const QString& src, const QString& dest );
|
||||
//void copyFileToSystem( bool resolve_local_urls );
|
||||
void deleteSymlink(bool using_fast_path);
|
||||
void deleteManyDirs(bool using_fast_path);
|
||||
void deleteManyFilesTogether(bool using_fast_path);
|
||||
void moveDestAlreadyExistsAutoRename(const QString& destDir, bool moveDirs);
|
||||
|
||||
int m_result;
|
||||
|
|
|
@ -122,8 +122,9 @@ void KFileItemTest::testRootDirectory()
|
|||
KUrl url(rootPath);
|
||||
KIO::UDSEntry entry;
|
||||
entry.insert(KIO::UDSEntry::UDS_NAME, ".");
|
||||
entry.insert(KIO::UDSEntry::UDS_URL, rootPath);
|
||||
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
|
||||
KFileItem fileItem(entry, rootPath);
|
||||
KFileItem fileItem(entry);
|
||||
QCOMPARE(fileItem.text(), QString("."));
|
||||
QVERIFY(fileItem.isLocalFile());
|
||||
QCOMPARE(fileItem.localPath(), url.path());
|
||||
|
@ -216,8 +217,9 @@ void KFileItemTest::testRename()
|
|||
KIO::UDSEntry entry;
|
||||
const QString origName = QString::fromLatin1("foo");
|
||||
entry.insert(KIO::UDSEntry::UDS_NAME, origName);
|
||||
entry.insert(KIO::UDSEntry::UDS_URL, "/dir/foo");
|
||||
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
|
||||
KFileItem fileItem(entry, KUrl("/dir/foo"));
|
||||
KFileItem fileItem(entry);
|
||||
QCOMPARE(fileItem.name(), origName);
|
||||
QCOMPARE(fileItem.text(), origName);
|
||||
const QString newName = QString::fromLatin1("FiNeX_rocks");
|
||||
|
|
Loading…
Add table
Reference in a new issue