summaryrefslogtreecommitdiffstats
path: root/tests/auto/input
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-07-21 12:01:15 +0200
committerSean Harmer <sean.harmer@kdab.com>2017-07-22 10:20:12 +0000
commit2a0327d15d9c3fe2201bb47f0117b8385d86fd67 (patch)
tree90281c866191337c344a49afcde93cde70e621ec /tests/auto/input
parent008b3906bd28b235e3f0fb6a7429513df7b9cdc0 (diff)
Use QSharedPointer::create() more
This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: none. Change-Id: Ic6368521ebf5841267ffe7917cc652627f7b26a7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/input')
-rw-r--r--tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp2
-rw-r--r--tests/auto/input/action/tst_action.cpp2
-rw-r--r--tests/auto/input/actioninput/tst_actioninput.cpp4
-rw-r--r--tests/auto/input/analogaxisinput/tst_analogaxisinput.cpp4
-rw-r--r--tests/auto/input/axis/tst_axis.cpp2
-rw-r--r--tests/auto/input/axisaccumulator/tst_axisaccumulator.cpp2
-rw-r--r--tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp14
-rw-r--r--tests/auto/input/inputchord/tst_inputchord.cpp2
-rw-r--r--tests/auto/input/inputsequence/tst_inputsequence.cpp4
-rw-r--r--tests/auto/input/keyboardhandler/tst_keyboardhandler.cpp6
-rw-r--r--tests/auto/input/qaxisaccumulator/tst_qaxisaccumulator.cpp2
11 files changed, 22 insertions, 22 deletions
diff --git a/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp b/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp
index 0e80b2478..97e9b7c77 100644
--- a/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp
+++ b/tests/auto/input/abstractaxisinput/tst_abstractaxisinput.cpp
@@ -138,7 +138,7 @@ private Q_SLOTS:
// WHEN
TestDevice device;
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("sourceDevice");
updateChange->setValue(QVariant::fromValue(device.id()));
backendAxisInput.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/action/tst_action.cpp b/tests/auto/input/action/tst_action.cpp
index 91ca2f794..7ef9bca1e 100644
--- a/tests/auto/input/action/tst_action.cpp
+++ b/tests/auto/input/action/tst_action.cpp
@@ -113,7 +113,7 @@ private Q_SLOTS:
Qt3DCore::QPropertyUpdatedChangePtr updateChange;
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendAction.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/actioninput/tst_actioninput.cpp b/tests/auto/input/actioninput/tst_actioninput.cpp
index fd87606a7..23dfaad64 100644
--- a/tests/auto/input/actioninput/tst_actioninput.cpp
+++ b/tests/auto/input/actioninput/tst_actioninput.cpp
@@ -102,7 +102,7 @@ private Q_SLOTS:
QCOMPARE(backendActionInput.buttons(), QVector<int>() << 64);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendActionInput.sceneChangeEvent(updateChange);
@@ -112,7 +112,7 @@ private Q_SLOTS:
// WHEN
TestDevice device;
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("sourceDevice");
updateChange->setValue(QVariant::fromValue(device.id()));
backendActionInput.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/analogaxisinput/tst_analogaxisinput.cpp b/tests/auto/input/analogaxisinput/tst_analogaxisinput.cpp
index faa7385bc..a37c37e96 100644
--- a/tests/auto/input/analogaxisinput/tst_analogaxisinput.cpp
+++ b/tests/auto/input/analogaxisinput/tst_analogaxisinput.cpp
@@ -107,7 +107,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.axis(), 32);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendAxisInput.sceneChangeEvent(updateChange);
@@ -117,7 +117,7 @@ private Q_SLOTS:
// WHEN
TestDevice device;
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("sourceDevice");
updateChange->setValue(QVariant::fromValue(device.id()));
backendAxisInput.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/axis/tst_axis.cpp b/tests/auto/input/axis/tst_axis.cpp
index dc8b225ba..42f7f56fc 100644
--- a/tests/auto/input/axis/tst_axis.cpp
+++ b/tests/auto/input/axis/tst_axis.cpp
@@ -114,7 +114,7 @@ private Q_SLOTS:
Qt3DCore::QPropertyUpdatedChangePtr updateChange;
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendAxis.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/axisaccumulator/tst_axisaccumulator.cpp b/tests/auto/input/axisaccumulator/tst_axisaccumulator.cpp
index 94cb71030..8e0b499fd 100644
--- a/tests/auto/input/axisaccumulator/tst_axisaccumulator.cpp
+++ b/tests/auto/input/axisaccumulator/tst_axisaccumulator.cpp
@@ -114,7 +114,7 @@ private Q_SLOTS:
Qt3DCore::QPropertyUpdatedChangePtr updateChange;
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendAxisAccumulator.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp b/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp
index 90867a747..18887cfe6 100644
--- a/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp
+++ b/tests/auto/input/buttonaxisinput/tst_buttonaxisinput.cpp
@@ -127,7 +127,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.buttons(), QVector<int>() << 64);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(0.5f);
updateChange->setPropertyName("scale");
backendAxisInput.sceneChangeEvent(updateChange);
@@ -136,7 +136,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.scale(), 0.5f);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendAxisInput.sceneChangeEvent(updateChange);
@@ -146,7 +146,7 @@ private Q_SLOTS:
// WHEN
TestDevice device;
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("sourceDevice");
updateChange->setValue(QVariant::fromValue(device.id()));
backendAxisInput.sceneChangeEvent(updateChange);
@@ -155,7 +155,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.sourceDevice(), device.id());
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(0.42f);
updateChange->setPropertyName("acceleration");
backendAxisInput.sceneChangeEvent(updateChange);
@@ -164,7 +164,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.acceleration(), 0.42f);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(-0.42f);
updateChange->setPropertyName("acceleration");
backendAxisInput.sceneChangeEvent(updateChange);
@@ -173,7 +173,7 @@ private Q_SLOTS:
QVERIFY(qIsInf(backendAxisInput.acceleration()));
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(0.43f);
updateChange->setPropertyName("deceleration");
backendAxisInput.sceneChangeEvent(updateChange);
@@ -182,7 +182,7 @@ private Q_SLOTS:
QCOMPARE(backendAxisInput.deceleration(), 0.43f);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(-0.43f);
updateChange->setPropertyName("deceleration");
backendAxisInput.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/inputchord/tst_inputchord.cpp b/tests/auto/input/inputchord/tst_inputchord.cpp
index d3ad1c84a..093bd29f7 100644
--- a/tests/auto/input/inputchord/tst_inputchord.cpp
+++ b/tests/auto/input/inputchord/tst_inputchord.cpp
@@ -113,7 +113,7 @@ private Q_SLOTS:
QCOMPARE(backendInputChord.timeout(), 250000000);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendInputChord.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/inputsequence/tst_inputsequence.cpp b/tests/auto/input/inputsequence/tst_inputsequence.cpp
index a73572553..b5630ddb5 100644
--- a/tests/auto/input/inputsequence/tst_inputsequence.cpp
+++ b/tests/auto/input/inputsequence/tst_inputsequence.cpp
@@ -118,7 +118,7 @@ private Q_SLOTS:
QCOMPARE(backendInputSequence.timeout(), 250000000);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setValue(150);
updateChange->setPropertyName("buttonInterval");
backendInputSequence.sceneChangeEvent(updateChange);
@@ -127,7 +127,7 @@ private Q_SLOTS:
QCOMPARE(backendInputSequence.buttonInterval(), 150000000);
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendInputSequence.sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/keyboardhandler/tst_keyboardhandler.cpp b/tests/auto/input/keyboardhandler/tst_keyboardhandler.cpp
index 4314660ec..3681f3554 100644
--- a/tests/auto/input/keyboardhandler/tst_keyboardhandler.cpp
+++ b/tests/auto/input/keyboardhandler/tst_keyboardhandler.cpp
@@ -109,7 +109,7 @@ private Q_SLOTS:
QCOMPARE(backendKeyboardHandler->keyboardDevice(), device.id());
// WHEN (still disabled, nothing should happen)
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("focus");
updateChange->setValue(true);
backendKeyboardHandler->sceneChangeEvent(updateChange);
@@ -118,7 +118,7 @@ private Q_SLOTS:
QVERIFY(backendKeyboardDevice->lastKeyboardInputRequester().isNull());
// WHEN
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("enabled");
updateChange->setValue(true);
backendKeyboardHandler->sceneChangeEvent(updateChange);
@@ -127,7 +127,7 @@ private Q_SLOTS:
QCOMPARE(backendKeyboardHandler->isEnabled(), true);
// WHEN (now enabled, should request focus)
- updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
updateChange->setPropertyName("focus");
updateChange->setValue(true);
backendKeyboardHandler->sceneChangeEvent(updateChange);
diff --git a/tests/auto/input/qaxisaccumulator/tst_qaxisaccumulator.cpp b/tests/auto/input/qaxisaccumulator/tst_qaxisaccumulator.cpp
index 3df09a67a..2447c564d 100644
--- a/tests/auto/input/qaxisaccumulator/tst_qaxisaccumulator.cpp
+++ b/tests/auto/input/qaxisaccumulator/tst_qaxisaccumulator.cpp
@@ -186,7 +186,7 @@ private Q_SLOTS:
QCOMPARE(velocity(), 0.0f);
// WHEN
- valueChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
+ valueChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId());
valueChange->setPropertyName("velocity");
valueChange->setValue(123.0f);
sceneChangeEvent(valueChange);