D12743: Unit tests fixes

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Mon May 28 16:08:04 UTC 2018

kossebau added inline comments.


> arrowdodger wrote in test_pluginenabling.cpp:138
> Both using `QJsonValue` instead of `auto` or `value()` instead of `operator[]` also make the crash go away. How would you prefer me fixing this code?

My personal preference would be to go for explicit `QJsonValue` as result type then. This would be most consistent with other code I have found elsewhere in KDE spheres (incl. normal kdevelop code reading that very data property).

IIUC any temporary objects in the chained call are only destroyed once the complete call has been evaluated, so using the non-const operator[] with the `QJsonValueRef` should be fine inside the chained calls, just the final lvalue type should be not a reference type, but a "normal" value type.

  R32 KDevelop


To: arrowdodger, #kdevelop, mwolff
Cc: kossebau, mwolff, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180528/0015d0f9/attachment.html>

More information about the KDevelop-devel mailing list