D7430: Add unit test

David Faure noreply at phabricator.kde.org
Sun Sep 3 08:07:12 UTC 2017


dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  Looks good, just some minor things.

INLINE COMMENTS

> privilegejobtest.cpp:37
> +#define KIO_JOB_FLAGS KIO::HideProgressInfo | KIO::PrivilegeExecution
> +#define LOCALFILE(x) QUrl::fromLocalFile(x)
> +

#define should not be used in C++11. This can just as well be an inline function (not that I see much point anyway, writing QUrl::fromLocalFile is more readable and not that many more characters)

And the enum values above can be static const int or static const QFileDevice::Permissions.

> privilegejobtest.cpp:45
> +    cleanupTestCase();
> +    homeTmpDir();
> +    m_testFilePath = homeTmpDir() + "testfile";

not needed, called by the line below

> privilegejobtest.cpp:99
> +
> +    // Recursive delete
> +    job = KIO::del(LOCALFILE(homeTmpDir()), KIO_JOB_FLAGS);

extract this into a different test method

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D7430

To: chinmoyr, dfaure
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170903/c18feb42/attachment.html>


More information about the Kde-frameworks-devel mailing list