D17455: Write unit tests for DownloadManager

Alex Kovrigin noreply at phabricator.kde.org
Fri Dec 14 20:46:31 GMT 2018

alexkovrigin added a comment.

  Sorry for being late for one day...


> jjazeix wrote in DownloadManagerTest.cpp:172
> This function is a bit tricky and not really easy to test.
> Basically, when we register an activity, we use the following path: "qrc:/gcompris/src/activities/{activity_name}".
> The function isDataRegistered looks for data in "qrc:/gcompris/data" which is filled in only if we have registered a specific data file "words.rcc".
> But, this file is not compiled and needs to be downloaded (~80Mo). We don't want this (because it will be downloaded at every commit).
> If we want to test this function, I think we can try to mock the registerResource to "save" a fake data in the ":/gcompris/data" resource.
> Not sure if it would work, but having a local qrc file containing one file in ":/gcompris/data/" and doing INIT_REGISTER_RESOURCE on the qrc. More info can be found in https://doc.qt.io/qt-5/resources.html (first and last paragraphs).

I think, I did it. Don't think it's the nicest solution, but it does its job

> jjazeix wrote in DownloadManagerTest.cpp:191
> typo (Resource) + use const reference for passing arguments that won't be updated to avoid copies.

I removed those functions into the caller one.

  R2 GCompris


To: alexkovrigin, jjazeix
Cc: alexkovrigin, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20181214/3593d951/attachment-0001.html>

More information about the kde-edu mailing list