From 92ca09147fc239762927595165f71a0d1ecff98f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Sep 2017 19:20:46 -0700 Subject: Restore compatibility with pre-5.9 Keccak calculation Commit 12c5264d9add1826d543c36d893db77262195fc6 fixed the calculation of SHA-3 in QCryptographicHash: we were previously calculating Keccak. Unfortunately, turns out that replacing the algorithm wasn't the best idea: there are people who need to compare with the result obtained from a previous version of Qt and stored somewhere. This commit restores the enum values 7 through 10 to mean Keccak and moves SHA-3 to 12 through 15. The "Sha3_nnn" enums will switch between the two according to the QT_SHA3_KECCAK_COMPAT macro. [ChangeLog][Important Behavior Changes] This version of Qt restores compatibility with pre-5.9.0 calculation of QCryptographicHash algorithms that were labelled "Sha3_nnn": that is, applications compiled with old versions of Qt will continue using the Keccak algorithm. Applications recompiled with this version will use SHA-3, unless QT_SHA3_KECCAK_COMPAT is #define'd prior to #include . [ChangeLog][Binary Compatibility Note] This version of Qt changes the values assigned to enumerations QCryptographicHash::Sha3_nnn. Applications compiled with this version and using those enumerations will not work with Qt 5.9.0 and 5.9.1, unless QT_SHA3_KECCAK_COMPAT is defined. Task-number: QTBUG-62025 Discussed-at: http://lists.qt-project.org/pipermail/development/2017-September/030818.html Change-Id: I6e1fe42ae4b742a7b811fffd14e418fc04f096c3 Reviewed-by: Lars Knoll --- tests/benchmarks/corelib/tools/qcryptographichash/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp index 5799b32b1c..507e2af708 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp @@ -79,6 +79,14 @@ const char *algoname(int i) return "sha3_384-"; case QCryptographicHash::Sha3_512: return "sha3_512-"; + case QCryptographicHash::Keccak_224: + return "keccak_224-"; + case QCryptographicHash::Keccak_256: + return "keccak_256-"; + case QCryptographicHash::Keccak_384: + return "keccak_384-"; + case QCryptographicHash::Keccak_512: + return "keccak_512-"; } Q_UNREACHABLE(); return 0; -- cgit v1.2.3 From 08e083e682d92290e36e4fb09abaf0318575dd41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 8 Sep 2017 18:42:25 +0200 Subject: Ensure result of all QTest::qWaitFor are verified The qWaitFor functions themselves can not trigger a test failure, as that will not result in the test function exiting early, so every single call to qWaitFor needs to be wrapped in a QVERIFY. Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8 Reviewed-by: Thiago Macieira --- .../gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp | 2 +- .../gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp | 2 +- tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 4 ++-- tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp | 2 +- tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp | 2 +- tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp index 55f2fd0dcc..87ab80d74f 100644 --- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp +++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp @@ -326,7 +326,7 @@ void tst_GraphicsViewBenchmark::initTestCase() currentListSize = -1; currentListType = None; - QTest::qWaitForWindowShown(mMainView); + QVERIFY(QTest::qWaitForWindowShown(mMainView)); } void tst_GraphicsViewBenchmark::cleanupTestCase() diff --git a/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp index b1a54a831d..1db130203a 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp @@ -110,7 +110,7 @@ void tst_QGraphicsLayout::invalidate() view->show(); - QTest::qWaitForWindowShown(view); + QVERIFY(QTest::qWaitForWindowShown(view)); // ...then measure... diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index cdec833f4e..9bb5231528 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -160,7 +160,7 @@ void tst_QGraphicsView::initTestCase() mView.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mView.tryResize(100, 100); mView.show(); - QTest::qWaitForWindowExposed(&mView); + QVERIFY(QTest::qWaitForWindowExposed(&mView)); QTest::qWait(300); processEvents(); } @@ -409,7 +409,7 @@ void tst_QGraphicsView::chipTester() tester.setOpenGL(opengl); tester.setOperation(ChipTester::Operation(operation)); tester.show(); - QTest::qWaitForWindowExposed(&tester); + QVERIFY(QTest::qWaitForWindowExposed(&tester)); QTest::qWait(250); processEvents(); diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp index aeec0624e8..b9af7a55cd 100644 --- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp +++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp @@ -122,7 +122,7 @@ private: void tst_QWidget::initTestCase() { widget.show(); - QTest::qWaitForWindowExposed(&widget); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); QTest::qWait(300); processEvents(); } diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp index 62a9096b7e..c2ce15f720 100644 --- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp +++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp @@ -224,7 +224,7 @@ void tst_QtBench::qtBench() BenchWidget widget(reinterpret_cast(benchmark)); widget.show(); - QTest::qWaitForWindowExposed(&widget); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); while (!widget.done()) { widget.update(); diff --git a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp index c1e6d780ba..9dbf618dd9 100644 --- a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp +++ b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp @@ -168,7 +168,7 @@ void tst_qstylesheetstyle::grid() w->setStyleSheet("/* */"); if(show) { w->show(); - QTest::qWaitForWindowExposed(w); + QVERIFY(QTest::qWaitForWindowExposed(w)); QApplication::processEvents(); QTest::qWait(30); QApplication::processEvents(); -- cgit v1.2.3