D10119: baloo-widgets: Create test to assert metaDataRequestFinished is emitted once only

Elvis Angelaccio noreply at phabricator.kde.org
Fri Feb 9 22:20:58 GMT 2018


elvisangelaccio added a comment.


  Almost there, just coding style issues now :)

INLINE COMMENTS

> filemetadatawidgettest.cpp:25
> +
> +#include <kfileitem.h>
> +#include <QTest>

`#include <KFileItem>` (and remove the duplicate include above)

> filemetadatawidgettest.cpp:31
> +
> +// other options: QTEST_GUILESS_MAIN, QTEST_APPLESS_MAIN
> +QTEST_MAIN(FileMetadataWidgetTest)

This comment does not add much, please remove it

> filemetadatawidgettest.cpp:33
> +QTEST_MAIN(FileMetadataWidgetTest)
> +Q_DECLARE_METATYPE(KFileItemList)
> +

Not needed

> filemetadatawidgettest.cpp:38
> +    // Called before the first testfunction is executed
> +    qRegisterMetaType<KFileItemList>("KFileItemList");
> +}

Not needed

> filemetadatawidgettest.cpp:41-44
> +void FileMetadataWidgetTest::cleanupTestCase()
> +{
> +    // Called after the last testfunction was executed
> +}

empty function -> remove it

(`initTestCase()` and `cleanupTestCase()` definitions are not mandatory).

> filemetadatawidgettest.cpp:48
> +{
> +    // Called before each testfunction is executed
> +    m_widget = new Baloo::FileMetaDataWidget;

This comment does not add much, please remove it

> filemetadatawidgettest.cpp:54
> +{
> +    // Called after every testfunction
> +    delete m_widget;

This comment does not add much, please remove it

> filemetadatawidgettest.h:25
> +
> +#include "config.h"
> +#include <QObject>

Please move this include in the .cpp file

> filemetadatawidgettest.h:26
> +#include "config.h"
> +#include <QObject>
> +

Not needed

> filemetadatawidgettest.h:28
> +
> +#include <KFileItem>
> +#include <filemetadatawidget.h>

Not needed

> filemetadatawidgettest.h:51
> +
> +//#include "filemetadatawidgettest.moc"

Please remove

REPOSITORY
  R824 Baloo Widgets

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

To: michaelh, elvisangelaccio, smithjd, vhanda, ngraham, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180209/d64e441b/attachment.htm>


More information about the kfm-devel mailing list