diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-10-12 14:59:51 -0700 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-10-29 10:13:01 +0000 |
commit | 81f251660026fff198daf8920edc62bbc782ff7d (patch) | |
tree | 9939cc07543eb69b5ee8e80496fca4a42c45d5fd /tests/auto/corelib/global | |
parent | fd9dd8e95b7563a439b1672fa622729bdcb6f4fc (diff) |
QRandomGenerator: add system() and global()
Right now,this does really nothing. This commit is just to allow us to
transition the other modules (besides qtbase) to use the syntax that
will become the API.
I've marked three places to use the system CSPRNG:
1) the QHash seed
2) QUuid
3) QAuthenticator
I didn't think the HTTP multipart boundary needed to be
cryptographically safe, so I changed that one to the global generator.
Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/global')
-rw-r--r-- | tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp index d1c0c8e965..4b38d46317 100644 --- a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp +++ b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp @@ -364,7 +364,7 @@ void tst_QRandomGenerator::bounded() QCOMPARE(ivalue, int(expected)); // confirm only the bound now - setRNGControl(control & (SkipHWRNG|SkipSystemRNG|SkipMemfill)); + setRNGControl(control & (SkipHWRNG|SkipSystemRNG)); value = QRandomGenerator::bounded(sup); QVERIFY(value < sup); @@ -536,7 +536,6 @@ void tst_QRandomGenerator::stdUniformIntDistribution_data() auto newRow = [](quint32 max) { QTest::addRow("default:%u", max) << 0U << max; - QTest::addRow("direct:%u", max) << uint(SkipMemfill) << max; QTest::addRow("system:%u", max) << uint(SkipHWRNG) << max; #ifdef HAVE_FALLBACK_ENGINE QTest::addRow("fallback:%u", max) << uint(SkipHWRNG | SkipSystemRNG) << max; @@ -555,7 +554,7 @@ void tst_QRandomGenerator::stdUniformIntDistribution() { QFETCH(uint, control); QFETCH(quint32, max); - setRNGControl(control & (SkipHWRNG|SkipSystemRNG|SkipMemfill)); + setRNGControl(control & (SkipHWRNG|SkipSystemRNG)); { QRandomGenerator rd; @@ -653,7 +652,6 @@ void tst_QRandomGenerator::stdUniformRealDistribution_data() auto newRow = [](double min, double sup) { QTest::addRow("default:%g-%g", min, sup) << 0U << min << sup; - QTest::addRow("direct:%g-%g", min, sup) << uint(SkipMemfill) << min << sup; QTest::addRow("system:%g-%g", min, sup) << uint(SkipHWRNG) << min << sup; #ifdef HAVE_FALLBACK_ENGINE QTest::addRow("fallback:%g-%g", min, sup) << uint(SkipHWRNG | SkipSystemRNG) << min << sup; @@ -673,7 +671,7 @@ void tst_QRandomGenerator::stdUniformRealDistribution() QFETCH(uint, control); QFETCH(double, min); QFETCH(double, sup); - setRNGControl(control & (SkipHWRNG|SkipSystemRNG|SkipMemfill)); + setRNGControl(control & (SkipHWRNG|SkipSystemRNG)); { QRandomGenerator rd; |