Review Request 121972: Make ksycocadicttest work when sycoca does not exist yet.

Alex Merry alex.merry at kde.org
Sun Jan 11 09:45:27 UTC 2015



> 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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150111/74165fa6/attachment.html>


More information about the Kde-frameworks-devel mailing list