Review Request 126001: In KConfigTest::testEntryMap, convert QByteArray with nulls using a char *

David Faure faure at kde.org
Mon Nov 9 07:57:33 UTC 2015


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


Isn't this exactly the wrong fix? The goal of the test with embedded NULs in a QByteArray is to test that KConfig can be used to store binary data, isn't it? So I would think the expected value was correct, it's the KConfig code that is faulty. As a programmer I expect to be able to write binary data and read it back again, without it stopping at the first \0.

- David Faure


On Nov. 9, 2015, 12:23 a.m., Matthew Dawson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126001/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2015, 12:23 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Due to https://codereview.qt-project.org/#/c/106473/, Qt 5.6 keeps null
> characters in QByteArray -> QString conversions, which breaks this test as
> one QByteArray contains nulls.  Instead, convert the QByteArray to const
> char * first, so QString stops at the first null.
> 
> The actual  behaviour of KConfig is unchanged, as internally the conversion
> always went through a const char *, which avoids creating QStrings with
> null characters.
> 
> 
> Diffs
> -----
> 
>   autotests/kconfigtest.cpp 9a2998647b5e5f54d63059172b727505a8ae1c80 
> 
> Diff: https://git.reviewboard.kde.org/r/126001/diff/
> 
> 
> Testing
> -------
> 
> Tested on both Qt 5.5.1 and Qt 5.6 (commit e996d68f6130847637ba287518cff1289cfa48e5), tests all pass now.
> 
> 
> Thanks,
> 
> Matthew Dawson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151109/b4cac3ea/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list