[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: Review Request 121972: Make ksycocadicttest work when sycoca does not exist yet.
From:       "Alex Merry" <alex.merry () kde ! org>
Date:       2015-01-11 9:45:27
Message-ID: 20150111094527.19346.94075 () probe ! kde ! org
[Download RAW message or body]

--===============5377412103814085417==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit



> On Jan. 11, 2015, 1:03 a.m., David Faure wrote:
> > Can you explain to me what the patch really changes? AFAICS this is a no-op. The \
> > same logic with a different syntax.
> 
> Alex Merry wrote:
> Lazy evaluation of || means that if KSycoca::isAvailable() returns false, \
> KServiceType::serviceType("FakePluginType") is never called.

Incidentally, I started with a form where it was possibly more clear what is going \
on, but it just looks stupid - an `if` and an `else` branch containing only an `if` \
is normally written as an `if` followed by an `else if`, but in this case both \
branches have the same body.


- Alex


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


On Jan. 10, 2015, 7:42 p.m., Alex Merry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121972/
> -----------------------------------------------------------
> 
> (Updated Jan. 10, 2015, 7:42 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kservice
> 
> 
> Description
> -------
> 
> Using KServiceType::serviceType when the sycoca database does not yet
> exist can lead to an assert in the KServiceTypeFactory constructor being
> called, meaning we never get to the line where we rebuild sycoca.
> 
> 
> Diffs
> -----
> 
> autotests/ksycocadicttest.cpp cec9eeb9b40d96b42321fe7f50b8a60b0f5b3492 
> 
> Diff: https://git.reviewboard.kde.org/r/121972/diff/
> 
> 
> Testing
> -------
> 
> rm -rf ~/.qttest; ./ksycocadicttest
> 
> Without this patch, this fails with:
> 
> ********* Start testing of KSycocaDictTest *********
> Config: Using QtTest library 5.4.0, Qt 5.4.0 (x86_64-little_endian-lp64 shared \
> (dynamic) release build; by GCC 4.9.2) QDEBUG : KSycocaDictTest::initTestCase() \
> ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open ksycoca from \
> "/home/kde-devel/.qttest/cache/ksycoca5" QDEBUG : KSycocaDictTest::initTestCase() \
> ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open global ksycoca from  \
> "/home/kde-devel/.qttest/share/kservices5/ksycoca5" QDEBUG : \
> KSycocaDictTest::initTestCase() ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open ksycoca from \
> "/home/kde-devel/.qttest/cache/ksycoca5" QDEBUG : KSycocaDictTest::initTestCase() \
> ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open global ksycoca from  \
> "/home/kde-devel/.qttest/share/kservices5/ksycoca5" QDEBUG : \
> KSycocaDictTest::initTestCase() ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open ksycoca from \
> "/home/kde-devel/.qttest/cache/ksycoca5" QDEBUG : KSycocaDictTest::initTestCase() \
> ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::openDatabase?[0m: Trying to open global ksycoca from  \
> "/home/kde-devel/.qttest/share/kservices5/ksycoca5" QDEBUG : \
> KSycocaDictTest::initTestCase() ksycocadicttest(3942)/(kf5.kservice.sycoca) \
> ?[31m?[34mKSycocaPrivate::checkDatabase?[0m: Still no database... QFATAL : \
> KSycocaDictTest::initTestCase() ksycocadicttest(3942)/(default) ?[31munknown?[0m: \
> ASSERT failure in KServiceTypeFactory::KServiceTypeFactory(): "Could not open \
> sycoca database, you must run kbuildsycoca first!", file \
> /home/kde-devel/src/frameworks/kservice/src/services/kservicetypefactory.cpp, line \
> 38 FAIL!  : KSycocaDictTest::initTestCase() Received a fatal error.
> Loc: [Unknown file(0)]
> Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted
> ********* Finished testing of KSycocaDictTest *********
> 
> With the patch, it succeeds.
> 
> 
> Thanks,
> 
> Alex Merry
> 
> 


--===============5377412103814085417==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/121972/">https://git.reviewboard.kde.org/r/121972/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 11th, 2015, 1:03 a.m. UTC, <b>David \
Faure</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Can you explain to me what the patch really changes? \
AFAICS this is a no-op. The same logic with a different syntax.</p></pre>  \
</blockquote>




 <p>On January 11th, 2015, 9:25 a.m. UTC, <b>Alex Merry</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;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Lazy \
evaluation of || means that if KSycoca::isAvailable() returns false, \
KServiceType::serviceType("FakePluginType") is never called.</p></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;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Incidentally, I started with a form where it was possibly more clear what \
is going on, but it just looks stupid - an <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">if</code> and an <code style="text-rendering: inherit;color: \
#4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">else</code> \
branch containing only an <code style="text-rendering: inherit;color: \
#4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">if</code> is \
normally written as an <code style="text-rendering: inherit;color: #4444cc;padding: \
0;white-space: normal;margin: 0;line-height: inherit;">if</code> followed by an <code \
style="text-rendering: inherit;color: #4444cc;paddi  ng: 0;white-space: \
normal;margin: 0;line-height: inherit;">else if</code>, but in this case both \
branches have the same body.</p></pre> <br />










<p>- Alex</p>


<br />
<p>On January 10th, 2015, 7:42 p.m. UTC, Alex Merry wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for KDE Frameworks and David Faure.</div>
<div>By Alex Merry.</div>


<p style="color: grey;"><i>Updated Jan. 10, 2015, 7:42 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kservice
</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Using KServiceType::serviceType when the sycoca \
database does not yet exist can lead to an assert in the KServiceTypeFactory \
constructor being called, meaning we never get to the line where we rebuild \
sycoca.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">rm -rf ~/.qttest; ./ksycocadicttest</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Without this patch, this fails with:</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div \
class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span \
style="color: #666666">*********</span> Start testing of KSycocaDictTest <span \
style="color: #666666">*********</span> <span style="color: #A0A000">Config:</span> \
Using QtTest library <span style="color: #666666">5.4.0</span>, Qt <span \
style="color: #666666">5.4.0</span> (x86_64<span style="color: \
#666666">-</span>little_endian<span style="color: #666666">-</span>lp64 shared \
(dynamic) release build; by GCC <span style="color: #666666">4.9.2</span>) QDEBUG \
<span style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
ksycoca from <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/cache/ksycoca5&quot;</span> QDEBUG <span \
style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
global ksycoca from  <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/share/kservices5/ksycoca5&quot;</span> QDEBUG \
<span style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
ksycoca from <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/cache/ksycoca5&quot;</span> QDEBUG <span \
style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
global ksycoca from  <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/share/kservices5/ksycoca5&quot;</span> QDEBUG \
<span style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
ksycoca from <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/cache/ksycoca5&quot;</span> QDEBUG <span \
style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>openDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Trying to open \
global ksycoca from  <span style="color: \
#BA2121">&quot;/home/kde-devel/.qttest/share/kservices5/ksycoca5&quot;</span> QDEBUG \
<span style="color: #666666">:</span> KSycocaDictTest<span style="color: \
#666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(kf5.kservice.sycoca) <span \
style="color: #666666">?</span>[<span style="color: #666666">31</span>m<span \
style="color: #666666">?</span>[<span style="color: \
#666666">34</span>mKSycocaPrivate<span style="color: \
#666666">::</span>checkDatabase<span style="color: #666666">?</span>[<span \
style="color: #666666">0</span>m<span style="color: #666666">:</span> Still no \
database... QFATAL <span style="color: #666666">:</span> KSycocaDictTest<span \
style="color: #666666">::</span>initTestCase() ksycocadicttest(<span style="color: \
#666666">3942</span>)<span style="color: #666666">/</span>(<span style="color: \
#008000; font-weight: bold">default</span>) <span style="color: \
#666666">?</span>[<span style="color: #666666">31</span>munknown<span style="color: \
#666666">?</span>[<span style="color: #666666">0</span>m<span style="color: \
#666666">:</span> ASSERT failure in KServiceTypeFactory<span style="color: \
#666666">::</span>KServiceTypeFactory()<span style="color: #666666">:</span> <span \
style="color: #BA2121">&quot;Could not open sycoca database, you must run \
kbuildsycoca first!&quot;</span>, file <span style="color: #666666">/</span>home<span \
style="color: #666666">/</span>kde<span style="color: #666666">-</span>devel<span \
style="color: #666666">/</span>src<span style="color: \
#666666">/</span>frameworks<span style="color: #666666">/</span>kservice<span style=  \
"color: #666666">/</span>src<span style="color: #666666">/</span>services<span \
style="color: #666666">/</span>kservicetypefactory.cpp, line <span style="color: \
#666666">38</span> FAIL<span style="color: #666666">!</span>  <span style="color: \
#666666">:</span> KSycocaDictTest<span style="color: #666666">::</span>initTestCase() \
Received a fatal error.  <span style="color: #A0A000">Loc:</span> [Unknown file(<span \
style="color: #666666">0</span>)] <span style="color: #A0A000">Totals:</span> <span \
style="color: #666666">0</span> passed, <span style="color: #666666">1</span> failed, \
<span style="color: #666666">0</span> skipped, <span style="color: #666666">0</span> \
blacklisted <span style="color: #666666">*********</span> Finished testing of \
KSycocaDictTest <span style="color: #666666">*********</span> </pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">With the patch, it succeeds.</p></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>autotests/ksycocadicttest.cpp <span style="color: \
grey">(cec9eeb9b40d96b42321fe7f50b8a60b0f5b3492)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/121972/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>








  </div>
 </body>
</html>


--===============5377412103814085417==--



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic