KFilePlacesModelTest

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Sat May 7 18:11:50 UTC 2016


Il 07/05/2016 20:05, David Faure ha scritto:
> We disable seed randomisation and sse4.2 (can't remember why that mattered,
> that was something Volker found out iirc), and that made it pass until recently,
> I'm not sure what changed.

Isn't that inherently dangerous though?

Even with those disabled, iteration in a hash / set depends on the 
"history" of that set:

> #include <QtCore>
>
> int main()
> {
>     qputenv("QT_HASH_SEED", "0");
>     qputenv("QT_NO_CPU_FEATURE", "sse4.2");
>
>     QSet<QString> set1, set2;
>
>     // add 0-999, remove 10-999
>     for (int i = 0; i < 1000; ++i)
>         set1.insert(QString::number(i));
>
>     for (int i = 10; i < 1000; ++i)
>         set1.remove(QString::number(i));
>
>     // just add 0-9
>     for (int i = 0; i < 10; ++i)
>         set2.insert(QString::number(i));
>
>     qDebug() << (set1 == set2); // true
>     qDebug() << (set1.toList() == set2.toList()); // unpredictable, likely false
> }
>

Cheers,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4068 bytes
Desc: Firma crittografica S/MIME
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160507/273098a2/attachment-0001.bin>


More information about the Kde-frameworks-devel mailing list