summaryrefslogtreecommitdiffstats
path: root/tests/auto/input/qmousedevice/tst_qmousedevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/input/qmousedevice/tst_qmousedevice.cpp')
-rw-r--r--tests/auto/input/qmousedevice/tst_qmousedevice.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/input/qmousedevice/tst_qmousedevice.cpp b/tests/auto/input/qmousedevice/tst_qmousedevice.cpp
index fd2c8e603..6a8f39c71 100644
--- a/tests/auto/input/qmousedevice/tst_qmousedevice.cpp
+++ b/tests/auto/input/qmousedevice/tst_qmousedevice.cpp
@@ -50,6 +50,7 @@ private Q_SLOTS:
// THEN
QCOMPARE(mouseDevice.sensitivity(), 0.1f);
+ QCOMPARE(mouseDevice.updateAxesContinuously(), false);
QCOMPARE(mouseDevice.axisCount(), 4);
QCOMPARE(mouseDevice.buttonCount(), 3);
QCOMPARE(mouseDevice.axisNames(), QStringList()
@@ -96,6 +97,25 @@ private Q_SLOTS:
QCOMPARE(mouseDevice.sensitivity(), newValue);
QCOMPARE(spy.count(), 0);
}
+ {
+ // WHEN
+ QSignalSpy spy(&mouseDevice, SIGNAL(updateAxesContinuouslyChanged(bool)));
+ const bool newValue = true;
+ mouseDevice.setUpdateAxesContinuously(newValue);
+
+ // THEN
+ QVERIFY(spy.isValid());
+ QCOMPARE(mouseDevice.updateAxesContinuously(), newValue);
+ QCOMPARE(spy.count(), 1);
+
+ // WHEN
+ spy.clear();
+ mouseDevice.setUpdateAxesContinuously(newValue);
+
+ // THEN
+ QCOMPARE(mouseDevice.updateAxesContinuously(), newValue);
+ QCOMPARE(spy.count(), 0);
+ }
}
void checkCreationData()
@@ -175,6 +195,31 @@ private Q_SLOTS:
}
+ void checkUpdateAxesContinuouslyUpdate()
+ {
+ // GIVEN
+ TestArbiter arbiter;
+ Qt3DInput::QMouseDevice mouseDevice;
+ arbiter.setArbiterOnNode(&mouseDevice);
+
+ {
+ // WHEN
+ mouseDevice.setUpdateAxesContinuously(true);
+ // THEN
+ QCOMPARE(arbiter.dirtyNodes.size(), 1);
+ QCOMPARE(arbiter.dirtyNodes.front(), &mouseDevice);
+ }
+
+ {
+ // WHEN
+ mouseDevice.setSensitivity(true);
+
+ QCOMPARE(arbiter.dirtyNodes.size(), 1);
+ QCOMPARE(arbiter.dirtyNodes.front(), &mouseDevice);
+ }
+
+ }
+
};
QTEST_MAIN(tst_QMouseDevice)