summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-10-07 17:00:50 +0100
committerMike Krus <mike.krus@kdab.com>2019-10-09 09:58:56 +0100
commit5eff77db3ade7f407de62952ed0a79371f328096 (patch)
tree5fabf3c187eb3a026e7ef5ed8c70e6361afe9bfa /tests
parentd174057b01cbe8887b25880697ae33428c88cc6c (diff)
Update UpdateAxisActionJob to use direct sync
Change-Id: I227e1a5005a9001ac49d8b29daeb23be25fda53b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/input/action/tst_action.cpp32
-rw-r--r--tests/auto/input/axis/tst_axis.cpp31
-rw-r--r--tests/auto/input/qaction/tst_qaction.cpp16
-rw-r--r--tests/auto/input/qaxis/tst_qaxis.cpp21
4 files changed, 1 insertions, 99 deletions
diff --git a/tests/auto/input/action/tst_action.cpp b/tests/auto/input/action/tst_action.cpp
index 8a6cb902f..6b8b11b80 100644
--- a/tests/auto/input/action/tst_action.cpp
+++ b/tests/auto/input/action/tst_action.cpp
@@ -138,38 +138,6 @@ private Q_SLOTS:
QCOMPARE(backendAction.inputs().size(), 0);
}
- void checkActivePropertyBackendNotification()
- {
- // GIVEN
- TestArbiter arbiter;
- Qt3DInput::Input::Action backendAction;
- backendAction.setEnabled(true);
- Qt3DCore::QBackendNodePrivate::get(&backendAction)->setArbiter(&arbiter);
- const bool currentActionTriggeredValue = backendAction.actionTriggered();
-
- // WHEN
- backendAction.setActionTriggered(true);
-
- // THEN
- QVERIFY(currentActionTriggeredValue != backendAction.actionTriggered());
- QCOMPARE(arbiter.events.count(), 1);
- Qt3DCore::QPropertyUpdatedChangePtr change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
- QCOMPARE(change->propertyName(), "active");
- QCOMPARE(change->value().toBool(), backendAction.actionTriggered());
-
-
- arbiter.events.clear();
-
- // WHEN
- backendAction.setActionTriggered(true);
-
- // THEN
- QVERIFY(currentActionTriggeredValue != backendAction.actionTriggered());
- QCOMPARE(arbiter.events.count(), 0);
-
- arbiter.events.clear();
- }
-
void shouldNotActivateWhenDisabled()
{
// GIVEN
diff --git a/tests/auto/input/axis/tst_axis.cpp b/tests/auto/input/axis/tst_axis.cpp
index 8ad8098af..de9d5c553 100644
--- a/tests/auto/input/axis/tst_axis.cpp
+++ b/tests/auto/input/axis/tst_axis.cpp
@@ -139,37 +139,6 @@ private Q_SLOTS:
QCOMPARE(backendAxis.inputs().size(), 0);
}
- void checkValuePropertyBackendNotification()
- {
- // GIVEN
- TestArbiter arbiter;
- Qt3DInput::Input::Axis backendAxis;
- backendAxis.setEnabled(true);
- Qt3DCore::QBackendNodePrivate::get(&backendAxis)->setArbiter(&arbiter);
-
- // WHEN
- backendAxis.setAxisValue(454.0f);
-
- // THEN
- QCOMPARE(backendAxis.axisValue(), 454.0f);
- QCOMPARE(arbiter.events.count(), 1);
- Qt3DCore::QPropertyUpdatedChangePtr change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
- QCOMPARE(change->propertyName(), "value");
- QCOMPARE(change->value().toFloat(), backendAxis.axisValue());
-
- arbiter.events.clear();
-
- // WHEN
- backendAxis.setAxisValue(454.0f);
-
- // THEN
- QCOMPARE(backendAxis.axisValue(), 454.0f);
- QCOMPARE(arbiter.events.count(), 0);
-
- arbiter.events.clear();
-
- }
-
void shouldNotChangeValueWhenDisabled()
{
// GIVEN
diff --git a/tests/auto/input/qaction/tst_qaction.cpp b/tests/auto/input/qaction/tst_qaction.cpp
index 71b6911fe..8d097978f 100644
--- a/tests/auto/input/qaction/tst_qaction.cpp
+++ b/tests/auto/input/qaction/tst_qaction.cpp
@@ -131,22 +131,6 @@ private Q_SLOTS:
arbiter.events.clear();
}
- void checkActivePropertyChanged()
- {
- // GIVEN
- QCOMPARE(isActive(), false);
-
- // Note: simulate backend change to frontend
- // WHEN
- Qt3DCore::QPropertyUpdatedChangePtr valueChange(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
- valueChange->setPropertyName("active");
- valueChange->setValue(true);
- sceneChangeEvent(valueChange);
-
- // THEN
- QCOMPARE(isActive(), true);
- }
-
void checkActionInputBookkeeping()
{
// GIVEN
diff --git a/tests/auto/input/qaxis/tst_qaxis.cpp b/tests/auto/input/qaxis/tst_qaxis.cpp
index ae4d6861e..36d434c6a 100644
--- a/tests/auto/input/qaxis/tst_qaxis.cpp
+++ b/tests/auto/input/qaxis/tst_qaxis.cpp
@@ -38,10 +38,7 @@
#include "testpostmanarbiter.h"
-// We need to call QNode::clone which is protected
-// We need to call QAxis::sceneChangeEvent which is protected
-// So we sublcass QAxis instead of QObject
-class tst_QAxis: public Qt3DInput::QAxis
+class tst_QAxis: public QObject
{
Q_OBJECT
public:
@@ -128,22 +125,6 @@ private Q_SLOTS:
arbiter.events.clear();
}
- void checkValuePropertyChanged()
- {
- // GIVEN
- QCOMPARE(value(), 0.0f);
-
- // Note: simulate backend change to frontend
- // WHEN
- Qt3DCore::QPropertyUpdatedChangePtr valueChange(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
- valueChange->setPropertyName("value");
- valueChange->setValue(383.0f);
- sceneChangeEvent(valueChange);
-
- // THEN
- QCOMPARE(value(), 383.0f);
- }
-
void checkAxisInputBookkeeping()
{
// GIVEN