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

Michael Heidelbach noreply at phabricator.kde.org
Thu Feb 8 23:05:03 GMT 2018


michaelh added a comment.


  Treated all test equally:  ` QVERIFY(spy.wait(xxx));` -> `spy.wait(xxx)`
  `shouldSignalOnceWithoutFile()` and `shouldSignalOnceWithEmptyFile()` still fail, the others pass.
  
  The crux must be in `build/kde/applications/baloo-widgets/src/KF5BalooWidgets_autogen/include/moc_filemetadatawidget.cpp`:
  
    // SIGNAL 1
    void Baloo::FileMetaDataWidget::metaDataRequestFinished(const KFileItemList & _t1)
    {
        void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
        QMetaObject::activate(this, &staticMetaObject, 1, _a);
    }
  
  I can't read this, but hopefully you can tell why there is no signal when `_t1` is an empty list.

INLINE COMMENTS

> elvisangelaccio wrote in filemetadatawidgettest.cpp:62
> From the documentation of `QSignalSpy::wait()`:
> 
>   Starts an event loop that runs until the given signal is received. Optionally the event loop can return earlier on a timeout (in milliseconds).
>   
>   Returns true if the signal was emitted at least once in timeout milliseconds, otherwise returns false.
> 
> The signal IS emitted, but //before// you create the nested event loop. So `wait()` returns false because "no signal was emitted at least once in 500 ms".
> 
> Just remove this `QVERIFY()`, we don't need it.

Exactly that was the reason I had put this QEXPECT_FAIL in.
To understand how spy.count() can ever be > 1, will take a lot of reading and thinking.

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/20180208/9a4bc58b/attachment.htm>


More information about the kfm-devel mailing list