Review Request 127717: Fix error when destroying an default constructed KEduVocDocument

Andreas Cord-Landwehr cordlandwehr at kde.org
Fri May 27 10:50:25 UTC 2016



> On Mai 1, 2016, 1:27 nachm., Andreas Cord-Landwehr wrote:
> > It seems to me that you try a too complicated approach. Using QTest like done for the automatic unit tests in /autotests is much more convenient.
> > In particular that includes the test in the ctest list and will be executed on the CI system automatically.
> > At least, for now I do not see anything in your test that really prevents using QTest.
> > 
> > By convention, automatic unit tests should go to autotests/ while in tests/ only special test applications should be located, e.g. for testing GUI interactions for specific components.
> 
> Hartmut Riesenbeck wrote:
>     Thanks for your explanations, Andreas!
>     
>     I now moved everything to autotests and found a much more elegant way to capture the qWarning output from the library. Besides this approach works fine with QTest.

Thanks for the changes! A last minor: I would prefer to see the test split into a header and a source file since that is much more common in our source code.


- Andreas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127717/#review95053
-----------------------------------------------------------


On Mai 3, 2016, 3:46 nachm., Hartmut Riesenbeck wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127717/
> -----------------------------------------------------------
> 
> (Updated Mai 3, 2016, 3:46 nachm.)
> 
> 
> Review request for KDE Edu.
> 
> 
> Repository: libkeduvocdocument
> 
> 
> Description
> -------
> 
> When a KEduVocDocument which was constructed by the default constructor
> becomes destructed, the error message "QFile::remove: Empty or null
> file name" is given on stderr.
> 
> Since the file name of the KAutoSaveFile was not set in the default
> constructor, the KAutoSaveFile::remove() method in ~KEduVocDocument()
> have given this error message. Removed this method call and the
> following KAutoSaveFile::releaseLock(), because they are called in the
> KAutoSaveFile destructor as well but with check for file name.
> 
> Added unit test emptydocumenttest to proof the bugfix.
> 
> Since I'm not a cmake expert, I hope the test was added in the right way. I would be thankful for improvements.
> 
> 
> Diffs
> -----
> 
>   .gitignore PRE-CREATION 
>   keduvocdocument/autotests/CMakeLists.txt 05580b6c5e8ad88fd15971cc6194aa4c22ffb558 
>   keduvocdocument/autotests/emptydocumenttest.cpp PRE-CREATION 
>   keduvocdocument/keduvocdocument.cpp e8e48e90ef70477e18559936c3cb36fed492d543 
> 
> Diff: https://git.reviewboard.kde.org/r/127717/diff/
> 
> 
> Testing
> -------
> 
> Unit test emptydocumenttest
> 
> 
> Thanks,
> 
> Hartmut Riesenbeck
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20160527/36acf7e5/attachment.html>


More information about the kde-edu mailing list