[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Review Request 112978: Fix searchbar_test by auto-selecting "Yes?" when asked if we want to wrap
From: "Alexander Neundorf" <neundorf () kde ! org>
Date: 2013-10-01 21:40:47
Message-ID: 20131001214047.12650.7937 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On Sept. 30, 2013, 9:09 p.m., Alexander Neundorf wrote:
> > This is the code in KateSearchBar::find():
> >
> > const bool askWrap = !match.isValid() && (!selection.isValid() || \
> > !selectionOnly()); bool wrap = false;
> > if (askWrap) {
> > wrap = KMessageBox::...
> > }
> > if (wrap) {
> > inputRange = m_view->document()->documentRange();
> > match.searchText(inputRange, searchPattern());
> > }
> >
> >
> > Another way to make the test working again would be to modify this code so that \
> > the default whether to wrap and to ask can be set from the test. That way the \
> > test would be less hackish, OTOH the code would be modified to make the test \
> > succeed.
> > What do you prefer ?
> >
> > Sorry for breaking the test.
>
> Dominik Haumann wrote:
> To me, having e.g. SearchBar::setUnitTestRunning() { m_unitTestRunning = true; } \
> would be fine. This could then be used here. Another possibility would be to ask on \
> kde-devel, since there are for sure quite some developers who faced such issues \
> before.
Ok, done.
This is, as suggested, a member of KSearchBar now, the test succeeds again.
Or should unitTestMode() be a member of KateView, then it could be used (if needed) \
also in other places.
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112978/#review41054
-----------------------------------------------------------
On Sept. 29, 2013, 9:18 a.m., Simon St James wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112978/
> -----------------------------------------------------------
>
> (Updated Sept. 29, 2013, 9:18 a.m.)
>
>
> Review request for Kate and Alexander Neundorf.
>
>
> Repository: kate
>
>
> Description
> -------
>
> The kate searchbar_test test has been failing since \
> ed14ef518e8cf86420727dd6604af4489a9d2e2b as this introduces a KDialog that pops up \
> asking if we want the search to wrap around, causing the test to time out. Get rid \
> of failures by adding a new class, AnswerKMessageDialog, that responds to the "wrap \
> search?" dialog with a "Yes".
> There are probably better ways of doing these; please propose any you think of here \
> and I'll probably do that instead :)
>
> Diffs
> -----
>
> tests/searchbar_test.h cd30c7e
> tests/searchbar_test.cpp af4ddd8
>
> Diff: http://git.reviewboard.kde.org/r/112978/diff/
>
>
> Testing
> -------
>
> searchbar_test now passes.
>
>
> Thanks,
>
> Simon St James
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/112978/">http://git.reviewboard.kde.org/r/112978/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On September 30th, 2013, 9:09 p.m. UTC, \
<b>Alexander Neundorf</b> wrote:</p> <blockquote style="margin-left: 1em; \
border-left: 2px solid #d0d0d0; padding-left: 10px;"> <pre style="white-space: \
pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: \
-o-pre-wrap; word-wrap: break-word;">This is the code in KateSearchBar::find():
const bool askWrap = !match.isValid() && (!selection.isValid() || \
!selectionOnly()); bool wrap = false;
if (askWrap) {
wrap = KMessageBox::...
}
if (wrap) {
inputRange = m_view->document()->documentRange();
match.searchText(inputRange, searchPattern());
}
Another way to make the test working again would be to modify this code so that the \
default whether to wrap and to ask can be set from the test. That way the test would \
be less hackish, OTOH the code would be modified to make the test succeed.
What do you prefer ?
Sorry for breaking the test.</pre>
</blockquote>
<p>On October 1st, 2013, 7:47 a.m. UTC, <b>Dominik Haumann</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">To me, having e.g. \
SearchBar::setUnitTestRunning() { m_unitTestRunning = true; } would be fine. This \
could then be used here. Another possibility would be to ask on kde-devel, since \
there are for sure quite some developers who faced such issues before.</pre> \
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, done. This is, as \
suggested, a member of KSearchBar now, the test succeeds again. Or should \
unitTestMode() be a member of KateView, then it could be used (if needed) also in \
other places. </pre>
<br />
<p>- Alexander</p>
<br />
<p>On September 29th, 2013, 9:18 a.m. UTC, Simon St James wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Kate and Alexander Neundorf.</div>
<div>By Simon St James.</div>
<p style="color: grey;"><i>Updated Sept. 29, 2013, 9:18 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kate
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The kate searchbar_test test has been failing since \
ed14ef518e8cf86420727dd6604af4489a9d2e2b as this introduces a KDialog that pops up \
asking if we want the search to wrap around, causing the test to time out. Get rid \
of failures by adding a new class, AnswerKMessageDialog, that responds to the \
"wrap search?" dialog with a "Yes".
There are probably better ways of doing these; please propose any you think of here \
and I'll probably do that instead :) </pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">searchbar_test now passes.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>tests/searchbar_test.h <span style="color: grey">(cd30c7e)</span></li>
<li>tests/searchbar_test.cpp <span style="color: grey">(af4ddd8)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/112978/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic