qt6-bb10/tests/auto/corelib/io/qtemporaryfile
Thiago Macieira 5483b30868 QTemporaryFile: fix the generation of names from templates
First and most importantly, let's not use more than half of the template
for the application's PID. With over 71% of all PIDs on a typical Linux
system and 90% of those on a Darwin system having 5 decimal digits,
using them all in a template that is usually 6 characters long is
wasteful. That leaves only 1 character for the random part, thereby
reducing the number of temporary files possible to only 52. So limit the
PID to half the characters of the template.

Second, let's use QRandomGenerator::bounded to create the the random
part, instead of qrand (which is often unseeded at this point).

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52eda5e467395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:43 +00:00
..
resources
.gitignore
android_testdata.qrc
qtemporaryfile.pro Remove the traces of the discontinued android-no-sdk platform 2016-03-30 10:12:34 +00:00
qtemporaryfile.qrc
tst_qtemporaryfile.cpp QTemporaryFile: fix the generation of names from templates 2017-06-12 06:14:43 +00:00