summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2019-05-22 16:51:54 +0300
committerKaj Grönholm <kaj.gronholm@qt.io>2019-05-22 17:19:54 +0300
commit046c12a343a02f224a4bd76885e5de054a400f9f (patch)
tree71f4669177c909a29298effb0df2dac1a78f3438
parent1fc5b762e0e4f06444e4a3d32d221a6e23f3a914 (diff)
Fix autotests
CreateRenderFactory() requires second parameter now. Also since 24fcce4eee added performance view into stats, tested rendering output wasn't matching anymore. Adjust test so that image equality is confirmed with stats off. Task-number: QT3DS-3213 Change-Id: I58bfd324a406e148831fce3dd2b71d307d50599b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--tests/auto/runtime/Qt3DSRenderTestBase.cpp2
-rw-r--r--tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp22
2 files changed, 15 insertions, 9 deletions
diff --git a/tests/auto/runtime/Qt3DSRenderTestBase.cpp b/tests/auto/runtime/Qt3DSRenderTestBase.cpp
index 0a74e286..f4ab0793 100644
--- a/tests/auto/runtime/Qt3DSRenderTestBase.cpp
+++ b/tests/auto/runtime/Qt3DSRenderTestBase.cpp
@@ -78,7 +78,7 @@ bool NVRenderTestBase::initializeQt3DSRenderer(QSurfaceFormat format)
{
m_coreFactory = qt3ds::render::IQt3DSRenderFactoryCore::CreateRenderFactoryCore("", m_windowSystem,
m_timeProvider);
- m_factory = m_coreFactory->CreateRenderFactory(format);
+ m_factory = m_coreFactory->CreateRenderFactory(format, false);
m_rc = m_factory->GetQt3DSRenderContext();
m_renderImpl = new qt3ds::render::Qt3DSRendererImpl(*m_rc);
diff --git a/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp b/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp
index e300979f..4f299075 100644
--- a/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp
+++ b/tests/auto/studio3d/q3dssurfaceviewer/tst_q3dssurfaceviewer.cpp
@@ -688,6 +688,12 @@ void tst_Q3DSSurfaceViewer::testSettings()
QImage image2 = m_viewer->grab();
QVERIFY(image1 != image2);
+ s->setShowRenderStats(false);
+ QCOMPARE(spy1.count(), 1);
+ QCOMPARE(spy2.count(), 2);
+ QCOMPARE(spy3.count(), 0);
+ QCOMPARE(spy4.count(), 0);
+
// ShadeMode
image1 = m_viewer->grab();
@@ -695,7 +701,7 @@ void tst_Q3DSSurfaceViewer::testSettings()
QCOMPARE(s->shadeMode(), Q3DSViewerSettings::ShadeModeShadedWireframe);
QCOMPARE(spy1.count(), 1);
- QCOMPARE(spy2.count(), 1);
+ QCOMPARE(spy2.count(), 2);
QCOMPARE(spy3.count(), 1);
QCOMPARE(spy4.count(), 0);
@@ -712,7 +718,7 @@ void tst_Q3DSSurfaceViewer::testSettings()
QCOMPARE(s->scaleMode(), Q3DSViewerSettings::ScaleModeFit);
QCOMPARE(spy1.count(), 1);
- QCOMPARE(spy2.count(), 1);
+ QCOMPARE(spy2.count(), 2);
QCOMPARE(spy3.count(), 2);
QCOMPARE(spy4.count(), 1);
@@ -723,7 +729,7 @@ void tst_Q3DSSurfaceViewer::testSettings()
QCOMPARE(s->scaleMode(), Q3DSViewerSettings::ScaleModeFill);
QCOMPARE(spy1.count(), 1);
- QCOMPARE(spy2.count(), 1);
+ QCOMPARE(spy2.count(), 2);
QCOMPARE(spy3.count(), 2);
QCOMPARE(spy4.count(), 2);
@@ -737,17 +743,17 @@ void tst_Q3DSSurfaceViewer::testSettings()
image1 = m_viewer->grab();
s->setMatteColor(Qt::yellow);
- s->setShowRenderStats(false);
+ s->setShowRenderStats(true);
s->setShadeMode(Q3DSViewerSettings::ShadeModeShadedWireframe);
s->setScaleMode(Q3DSViewerSettings::ScaleModeFit);
QCOMPARE(s->matteColor(), QColor(Qt::yellow));
- QCOMPARE(s->isShowRenderStats(), false);
+ QCOMPARE(s->isShowRenderStats(), true);
QCOMPARE(s->shadeMode(), Q3DSViewerSettings::ShadeModeShadedWireframe);
QCOMPARE(s->scaleMode(), Q3DSViewerSettings::ScaleModeFit);
QCOMPARE(spy1.count(), 2);
- QCOMPARE(spy2.count(), 2);
+ QCOMPARE(spy2.count(), 3);
QCOMPARE(spy3.count(), 3);
QCOMPARE(spy4.count(), 3);
@@ -757,12 +763,12 @@ void tst_Q3DSSurfaceViewer::testSettings()
QStringLiteral("tst_q3dsurfaceviewer"));
QCOMPARE(s->matteColor(), QColor(Qt::cyan));
- QCOMPARE(s->isShowRenderStats(), true);
+ QCOMPARE(s->isShowRenderStats(), false);
QCOMPARE(s->shadeMode(), Q3DSViewerSettings::ShadeModeShaded);
QCOMPARE(s->scaleMode(), Q3DSViewerSettings::ScaleModeFill);
QCOMPARE(spy1.count(), 3);
- QCOMPARE(spy2.count(), 3);
+ QCOMPARE(spy2.count(), 4);
QCOMPARE(spy3.count(), 4);
QCOMPARE(spy4.count(), 4);