D11034: CoreApplicationSettingsTest
Himanshu Vishwakarma
noreply at phabricator.kde.org
Fri Mar 23 10:10:55 UTC 2018
himanshuvishwakarma added a comment.
In D11034#231907 <https://phabricator.kde.org/D11034#231907>, @jjazeix wrote:
> Can you check that if you instantiate a ApplicationSettingsMock object, then use ApplicationSettings::getInstance(), it returns the mock instead of creating a new ApplicationSettings object?
> As we use it this way on other classes (like ApplicationInfo), it would be better that, for tests, the getInstance() returns the mock instead of the real one (else we'll have the same issue as we had here, writing on the real configuration).
>
> Except this point (and the small one regarding parameters ordering), it seems good to me, I'll take a closer look this week-end to integrate it
Hi,
I have checked that it the when we use the ApplicationSettings::getInstance( ), after the instantiate object of ApplicationSettingsMock. It will not disturb the main config file anyway. It will disturb only when the object of ApplicationSettingsMock is not destroyed, that is the object of ApplicationSettingsMock is existing and then we call the function ApplicationSettings::getInstance( )
I have checked it by this methods
1. Change in the file ApplicationSettingsTest.cpp like this: https://paste.kde.org/pkfzgqgtx
Run the test.
Result: Function ApplcationSettingsTest will reflect the change in the file build/test/core/DummyApplicationSettingsTest.conf && Function ActivitySettingsTest will change in the file ~/.config/gcompris/gcompris-qt.conf
2. Change in the file ApplicationSettingsTest.cpp like this: https://paste.kde.org/p0vfonqvp
Run the test
Result: Now the result is reverse as expected i.e. Function ApplcationSettingsTest will reflect the change in the file: ~/.config/gcompris/gcompris-qt.conf && Function ActivitySettingsTest will change in the file: build/test/core/DummyApplicationSettingsTest.conf
Correct me if I am wrong...
REPOSITORY
R2 GCompris
REVISION DETAIL
https://phabricator.kde.org/D11034
To: himanshuvishwakarma, jjazeix, dmadaan, rudranilbasu, timotheegiet, #gcompris
Cc: #kde_edu, #gcompris, harrymecwan, ganeshredcobra, nityanandkumar, echarruau, rahulyadav, narvaez, scagarwal, apol, timotheegiet, hkaelberer, jjazeix, bcoudoin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20180323/76dd5a5f/attachment.html>
More information about the kde-edu
mailing list