[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/frameworks] kio/tests: Port kio tests away from kde_file.h
From:       Martin Klapetek <mklapetek () kde ! org>
Date:       2013-08-05 17:51:33
Message-ID: E1V6OwP-0000TW-NW () scm ! kde ! org
[Download RAW message or body]

Git commit 2dd3b2618b167c04c5c29793deb81320266656ac by Martin Klapetek.
Committed on 05/08/2013 at 17:50.
Pushed by mklapetek into branch 'frameworks'.

Port kio tests away from kde_file.h

REVIEW: 111891

M  +4    -4    kio/tests/fileundomanagertest.cpp
M  +5    -5    kio/tests/jobtest.cpp
M  +3    -3    kio/tests/kiotesthelper.h

http://commits.kde.org/kdelibs/2dd3b2618b167c04c5c29793deb81320266656ac

diff --git a/kio/tests/fileundomanagertest.cpp b/kio/tests/fileundomanagertest.cpp
index 9e51a21..08c950e 100644
--- a/kio/tests/fileundomanagertest.cpp
+++ b/kio/tests/fileundomanagertest.cpp
@@ -24,6 +24,7 @@
 #include <QDateTime>
 #include <QDir>
 #include <QFileInfo>
+#include <qplatformdefs.h>
 #include <kio/fileundomanager.h>
 
 #include <kio/copyjob.h>
@@ -32,7 +33,6 @@
 #include <kio/netaccess.h>
 #include <kprotocolinfo.h>
 
-#include <kde_file.h>
 #include <QDebug>
 #include <kconfig.h>
 #include <kconfiggroup.h>
@@ -83,12 +83,12 @@ static void createTestFile( const QString& path, const char* contents )
 static void createTestSymlink( const QString& path )
 {
     // Create symlink if it doesn't exist yet
-    KDE_struct_stat buf;
-    if ( KDE_lstat( QFile::encodeName( path ), &buf ) != 0 ) {
+    QT_STATBUF buf;
+    if ( QT_LSTAT( QFile::encodeName( path ), &buf ) != 0 ) {
         bool ok = symlink( "/IDontExist", QFile::encodeName( path ) ) == 0; // broken symlink
         if ( !ok )
             qFatal("couldn't create symlink: %s", strerror(errno));
-        QVERIFY( KDE_lstat( QFile::encodeName( path ), &buf ) == 0 );
+        QVERIFY( QT_LSTAT( QFile::encodeName( path ), &buf ) == 0 );
         QVERIFY( S_ISLNK( buf.st_mode ) );
     } else {
         QVERIFY( S_ISLNK( buf.st_mode ) );
diff --git a/kio/tests/jobtest.cpp b/kio/tests/jobtest.cpp
index 786ff53..7d40cb4 100644
--- a/kio/tests/jobtest.cpp
+++ b/kio/tests/jobtest.cpp
@@ -399,8 +399,8 @@ void JobTest::moveLocalFile( const QString& src, const QString& dest )
 
 static void moveLocalSymlink( const QString& src, const QString& dest )
 {
-    KDE_struct_stat buf;
-    QVERIFY ( KDE_lstat( QFile::encodeName( src ), &buf ) == 0 );
+    QT_STATBUF buf;
+    QVERIFY ( QT_LSTAT( QFile::encodeName( src ), &buf ) == 0 );
     QUrl u = QUrl::fromLocalFile( src );
     QUrl d = QUrl::fromLocalFile( dest );
 
@@ -412,7 +412,7 @@ static void moveLocalSymlink( const QString& src, const QString& dest )
     if ( !ok )
         qWarning() << job->error();
     QVERIFY( ok );
-    QVERIFY ( KDE_lstat( QFile::encodeName( dest ), &buf ) == 0 );
+    QVERIFY ( QT_LSTAT( QFile::encodeName( dest ), &buf ) == 0 );
     QVERIFY( !QFile::exists( src ) ); // not there anymore
 
     // move it back with KIO::move()
@@ -421,8 +421,8 @@ static void moveLocalSymlink( const QString& src, const QString& dest )
     job->setUiDelegateExtension(0);
     ok = job->exec();
     QVERIFY( ok );
-    QVERIFY ( KDE_lstat( QFile::encodeName( dest ), &buf ) != 0 ); // doesn't exist anymore
-    QVERIFY ( KDE_lstat( QFile::encodeName( src ), &buf ) == 0 ); // it's back
+    QVERIFY ( QT_LSTAT( QFile::encodeName( dest ), &buf ) != 0 ); // doesn't exist anymore
+    QVERIFY ( QT_LSTAT( QFile::encodeName( src ), &buf ) == 0 ); // it's back
 }
 
 void JobTest::moveLocalDirectory( const QString& src, const QString& dest )
diff --git a/kio/tests/kiotesthelper.h b/kio/tests/kiotesthelper.h
index 58eac9b..b0082fe 100644
--- a/kio/tests/kiotesthelper.h
+++ b/kio/tests/kiotesthelper.h
@@ -22,8 +22,8 @@
 #include <QDebug>
 #include <QtCore/qglobal.h>
 #include <qstandardpaths.h>
+#include <qplatformdefs.h>
 #include <QDir>
-#include <kde_file.h>
 #ifdef Q_OS_UNIX
 #include <utime.h>
 #else
@@ -79,8 +79,8 @@ static void createTestSymlink( const QString& path, const QByteArray& target = "
     bool ok = symlink( target.constData(), QFile::encodeName( path ) ) == 0; // broken symlink
     if ( !ok )
         qFatal("couldn't create symlink: %s", strerror(errno));
-    KDE_struct_stat buf;
-    QVERIFY( KDE_lstat( QFile::encodeName( path ), &buf ) == 0 );
+    QT_STATBUF buf;
+    QVERIFY( QT_LSTAT( QFile::encodeName( path ), &buf ) == 0 );
     QVERIFY( S_ISLNK( buf.st_mode ) );
     //qDebug( "symlink %s created", qPrintable( path ) );
     QVERIFY( QFileInfo( path ).isSymLink() );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic