Review Request 119014: KUrlRequester: fixing handling of start directory

David Faure faure at kde.org
Tue Jul 15 00:15:07 BST 2014



> On July 9, 2014, 8:40 a.m., David Faure wrote:
> > Looks good, but I'd feel safer if the unittest (kio/tests/kurlrequestertest.cpp) was:
> > 1) checked for no regressions, and
> > 2) extended to cover the case of relative paths, and other things this patch is fixing.
> 
> Simon Bachmann wrote:
>     I need some help with the unittest:
>     I do understand the concept of "regular" unittests - the ones where you basically test output against expected values.
>     However, kurlrequestertest.cpp (and many other tests in kio/tests) seems to be a different kind of test, and I'm not sure I fully understand how they work.
>     It is my understanding that the test in question is interactive, i.e. the tester has to click through a series of dialogs showing variations of the widget in question and decide if the test passed, based on comments in the source, behaviour of the widget and console output. 
>     Is that correct? 
>     Are there any guidelines / best practices for these tests?
>     Thanks

Oops. I'm sorry, this is indeed not a unittest, but a GUI test program. In KF5 we have cleanly separated the two (tests vs autotests), but in kdelibs4 it was all mixed up.

I was confusing (in my head) with the existing unittests for KUrlCompletion (as used by kurlrequester), kio/tests/kurlcompletiontest.cpp.

I suppose a unittest for kurlrequester *could* be written though, by inspecting the fileDialog() to see how it got set up by KUrlRequester. But due to the lack of an existing test to start from, I can't force you to write additional tests as part of this change :)
Still, if you feel like writing a unittest for kurlrequester, that would be much appreciated.


- David


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


On June 29, 2014, 3:04 p.m., Simon Bachmann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119014/
> -----------------------------------------------------------
> 
> (Updated June 29, 2014, 3:04 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Bugs: 92237
>     http://bugs.kde.org/show_bug.cgi?id=92237
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> The handling of the start directory in the KUrlRequester is only halfway implemented. 
> More in detail:
> - m_startDir (the private field holding the start directory) is not initialised - the default value of startDir() is an empty URL instead of the current working dir.
> - when the start dir changes, it is not always passed to the KUrlCompletion object of the lineedit. The suggestions showed when entering a relative path into the LineEdit might be wrong as a consequence.
> - when selecting a file, the start directory does not change to the directory of the selected file - the API doc says it should. 
> - when the user entered a relative path into the LineEdit, url() returns a relative path instead of an absolute one.
> 
> This patch should fix these issues. 
> 
> 
> Diffs
> -----
> 
>   kio/kfile/kurlrequester.h 2083d4c 
>   kio/kfile/kurlrequester.cpp 661b428 
> 
> Diff: https://git.reviewboard.kde.org/r/119014/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Simon Bachmann
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140714/d080915b/attachment.htm>


More information about the kde-core-devel mailing list