summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2017-03-10 10:11:43 +0100
committerPaul Lemire <paul.lemire@kdab.com>2017-08-11 14:12:30 +0000
commit0f1586e66d21af972caf353ad90f29b43721921b (patch)
treeba6bf316910e47a6ebd6ade405b4465aed2d3396 /tests
parente881d3ca08da399640ca310ec9f8e1c71aefe352 (diff)
Unit tests for Vector3D
Change-Id: I605342efe0a9a5f6a9477916a66ff31956091cbd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/core/core.pro23
-rw-r--r--tests/auto/core/vector3d_base/tst_vector3d_base.cpp705
-rw-r--r--tests/auto/core/vector3d_base/vector3d_base.pro7
-rw-r--r--tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp832
-rw-r--r--tests/auto/core/vector3d_sse/vector3d_sse.pro8
5 files changed, 1566 insertions, 9 deletions
diff --git a/tests/auto/core/core.pro b/tests/auto/core/core.pro
index 33dd5a9a8..4ac74471e 100644
--- a/tests/auto/core/core.pro
+++ b/tests/auto/core/core.pro
@@ -20,14 +20,19 @@ SUBDIRS = \
qtConfig(private_tests) {
SUBDIRS += \
- qentity \
- qframeallocator \
- qtransform \
- threadpooler \
- qpostman \
- vector4d_base
+ qentity \
+ qframeallocator \
+ qtransform \
+ threadpooler \
+ qpostman \
+ vector4d_base \
+ vector3d_base
- QT_FOR_CONFIG += 3dcore-private
- qtConfig(qt3d-profile-jobs): SUBDIRS += aspectcommanddebugger
- qtConfig(qt3d-simd-sse2): SUBDIRS += vector4d_sse
+ QT_FOR_CONFIG += 3dcore-private
+ qtConfig(qt3d-profile-jobs): SUBDIRS += aspectcommanddebugger
+ qtConfig(qt3d-simd-sse2) {
+ SUBDIRS += \
+ vector4d_sse \
+ vector3d_sse
+ }
}
diff --git a/tests/auto/core/vector3d_base/tst_vector3d_base.cpp b/tests/auto/core/vector3d_base/tst_vector3d_base.cpp
new file mode 100644
index 000000000..c3e5390a9
--- /dev/null
+++ b/tests/auto/core/vector3d_base/tst_vector3d_base.cpp
@@ -0,0 +1,705 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <Qt3DCore/private/vector3d_p.h>
+
+class tst_Vector3D_Base: public QObject
+{
+ Q_OBJECT
+private Q_SLOTS:
+ void defaultConstruction()
+ {
+ // GIVEN
+ QVector3D vec3;
+
+ // THEN
+ QCOMPARE(vec3.x(), 0.0f);
+ QCOMPARE(vec3.y(), 0.0f);
+ QCOMPARE(vec3.z(), 0.0f);
+ }
+
+ void checkExplicitConstruction()
+ {
+ // GIVEN
+ QVector3D vec3(427.0f, 454.0f, 383.0f);
+
+ // THEN
+ QCOMPARE(vec3.x(), 427.0f);
+ QCOMPARE(vec3.y(), 454.0f);
+ QCOMPARE(vec3.z(), 383.0f);
+ }
+
+ void checkSelfAddition_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << 1.0f << 5.0f << 8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << 0.0f << 0.0f << 0.0f;
+ }
+
+ void checkSelfAddition()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo += QVector3D(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfSubstraction_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << -1.0f << -5.0f << -8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -10.0f << 16.0f << -8.0f;
+ }
+
+ void checkSelfSubstraction()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo -= QVector3D(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfMultiplication_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 16.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -25.0f << -64.0f << 16.0f;
+ }
+
+ void checkSelfMultiplication()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo *= QVector3D(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfDivision_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 0.25f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -1.0f << -1.0f << 1.0f;
+ }
+
+ void checkSelfDivision()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo /= QVector3D(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfDivisionFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f
+ << 0.0f << 0.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -1.0f << 4.0f << -5.0f;
+ }
+
+ void checkSelfDivisionFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo /= factor;
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfMultiplicationFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << -3.0f << 2.0f
+ << 1.0f
+ << 0.0f << -3.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -25.0f << 100.0f << -125.0f;
+ }
+
+ void checkSelfMultiplicationFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D vo(xO, yO, zO);
+
+ // WHEN
+ vo *= factor;
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkAddition_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << 1.0f << 5.0f << 8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << 0.0f << 0.0f << 0.0f;
+ }
+
+ void checkAddition()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+ QVector3D v1(xA, yA, zA);
+
+ // WHEN
+ QVector3D v2 = v0 + v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkSubstraction_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << -1.0f << -5.0f << -8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -10.0f << 16.0f << -8.0f;
+ }
+
+ void checkSubstraction()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+ QVector3D v1(xA, yA, zA);
+
+ // WHEN
+ QVector3D v2 = v0 - v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkMultiplication_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 16.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -25.0f << -64.0f << 16.0f;
+ }
+
+ void checkMultiplication()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+ QVector3D v1(xA, yA, zA);
+
+ // WHEN
+ QVector3D v2 = v0 * v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkDivision_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 0.25f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -1.0f << -1.0f << 1.0f;
+ }
+
+ void checkDivision()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+ QVector3D v1(xA, yA, zA);
+
+ // WHEN
+ QVector3D v2 = v0 / v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkDivisionFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f
+ << 0.0f << 0.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -1.0f << 4.0f << -5.0f;
+ }
+
+ void checkDivisionFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+
+ // WHEN
+ QVector3D v2 = v0 / factor;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkMultiplicationFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << -3.0f << 2.0f
+ << 1.0f
+ << 0.0f << -3.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -25.0f << 100.0f << -125.0f;
+ }
+
+ void checkMultiplicationFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ QVector3D v0(xO, yO, zO);
+
+ // WHEN
+ QVector3D v2 = v0 * factor;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkEquality()
+ {
+ {
+ // GIVEN
+ QVector3D v0;
+ QVector3D v1;
+
+ // THEN
+ QVERIFY(v0 == v1);
+ }
+ {
+ // GIVEN
+ QVector3D v0(1.0f, 2.0f, -5.0f);
+ QVector3D v1(1.0f, 2.0f, -5.0f);
+
+ // THEN
+ QVERIFY(v0 == v1);
+ }
+ }
+
+ void checkInequality()
+ {
+ {
+ // GIVEN
+ QVector3D v0;
+ QVector3D v1;
+
+ // THEN
+ QVERIFY(!(v0 != v1));
+ }
+ {
+ // GIVEN
+ QVector3D v0(1.0f, 2.0f, -5.0f);
+ QVector3D v1(1.0f, 5.0f, -5.0f);
+
+ // THEN
+ QVERIFY(v0 != v1);
+ }
+ }
+
+ void checkToQQVector3D()
+ {
+ {
+ // GIVEN
+ QVector3D v0;
+
+ // WHEN
+ QVector3D v1 = v0;
+
+ // THEN
+ QCOMPARE(v0.x(), v1.x());
+ QCOMPARE(v0.y(), v1.y());
+ QCOMPARE(v0.z(), v1.z());
+ }
+ {
+ // GIVEN
+ QVector3D v0(1.0f, 2.0f, -5.0f);
+
+ // WHEN
+ QVector3D v1 = v0;
+
+ // THEN
+ QCOMPARE(v0.x(), v1.x());
+ QCOMPARE(v0.y(), v1.y());
+ QCOMPARE(v0.z(), v1.z());
+ }
+ }
+};
+
+QTEST_MAIN(tst_Vector3D_Base)
+
+#include "tst_vector3d_base.moc"
diff --git a/tests/auto/core/vector3d_base/vector3d_base.pro b/tests/auto/core/vector3d_base/vector3d_base.pro
new file mode 100644
index 000000000..fa1ee87df
--- /dev/null
+++ b/tests/auto/core/vector3d_base/vector3d_base.pro
@@ -0,0 +1,7 @@
+TARGET = tst_vector3d_base
+CONFIG += testcase
+QT += testlib 3dcore 3dcore-private
+
+SOURCES += \
+ tst_vector3d_base.cpp
+
diff --git a/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp b/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp
new file mode 100644
index 000000000..8e6be5b3f
--- /dev/null
+++ b/tests/auto/core/vector3d_sse/tst_vector3d_sse.cpp
@@ -0,0 +1,832 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <Qt3DCore/private/vector3d_sse_p.h>
+
+using namespace Qt3DCore;
+
+class tst_Vector3D_SSE: public QObject
+{
+ Q_OBJECT
+private Q_SLOTS:
+
+ void checkAllocationAndAlignment()
+ {
+ // GIVEN
+ Vector3D_SSE *m = new Vector3D_SSE();
+
+ // THEN
+ QVERIFY((uintptr_t)m % 16 == 0);
+
+ // WHEN
+ delete m;
+
+ // THEN
+ // Should not crash
+ }
+
+ void defaultConstruction()
+ {
+ // GIVEN
+ Vector3D_SSE vec3;
+
+ // THEN
+ QCOMPARE(vec3.x(), 0.0f);
+ QCOMPARE(vec3.y(), 0.0f);
+ QCOMPARE(vec3.z(), 0.0f);
+ }
+
+ void checkExplicitConstruction()
+ {
+ // GIVEN
+ Vector3D_SSE vec3(427.0f, 454.0f, 383.0f);
+
+ // THEN
+ QCOMPARE(vec3.x(), 427.0f);
+ QCOMPARE(vec3.y(), 454.0f);
+ QCOMPARE(vec3.z(), 383.0f);
+ }
+
+ void checkSetters()
+ {
+ // GIVEN
+ Vector3D_SSE vec3;
+
+ // WHEN
+ vec3.setX(427.0f);
+ vec3.setY(454.0f);
+ vec3.setZ(383.0f);
+
+ // THEN
+ QCOMPARE(vec3.x(), 427.0f);
+ QCOMPARE(vec3.y(), 454.0f);
+ QCOMPARE(vec3.z(), 383.0f);
+ }
+
+
+ void checkSelfAddition_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << 1.0f << 5.0f << 8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << 0.0f << 0.0f << 0.0f;
+ }
+
+ void checkSelfAddition()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo += Vector3D_SSE(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfSubstraction_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << -1.0f << -5.0f << -8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -10.0f << 16.0f << -8.0f;
+ }
+
+ void checkSelfSubstraction()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo -= Vector3D_SSE(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfMultiplication_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 16.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -25.0f << -64.0f << 16.0f;
+ }
+
+ void checkSelfMultiplication()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo *= Vector3D_SSE(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfDivision_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 0.25f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -1.0f << -1.0f << 1.0f;
+ }
+
+ void checkSelfDivision()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo /= Vector3D_SSE(xA, yA, zA);
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfDivisionFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f
+ << 0.0f << 0.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -1.0f << 4.0f << -5.0f;
+ }
+
+ void checkSelfDivisionFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo /= factor;
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkSelfMultiplicationFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << -3.0f << 2.0f
+ << 1.0f
+ << 0.0f << -3.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -25.0f << 100.0f << -125.0f;
+ }
+
+ void checkSelfMultiplicationFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE vo(xO, yO, zO);
+
+ // WHEN
+ vo *= factor;
+
+ // THEN
+ QCOMPARE(vo.x(), xR);
+ QCOMPARE(vo.y(), yR);
+ QCOMPARE(vo.z(), zR);
+ }
+
+ void checkAddition_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << 1.0f << 5.0f << 8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << 0.0f << 0.0f << 0.0f;
+ }
+
+ void checkAddition()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+ Vector3D_SSE v1(xA, yA, zA);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 + v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkSubstraction_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 0.0f
+ << 1.0f << 5.0f << 8.0f
+ << -1.0f << -5.0f << -8.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << -4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -10.0f << 16.0f << -8.0f;
+ }
+
+ void checkSubstraction()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+ Vector3D_SSE v1(xA, yA, zA);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 - v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkMultiplication_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 16.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -25.0f << -64.0f << 16.0f;
+ }
+
+ void checkMultiplication()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+ Vector3D_SSE v1(xA, yA, zA);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 * v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkDivision_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("xA");
+ QTest::addColumn<float>("yA");
+ QTest::addColumn<float>("zA");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f << 5.0f << 8.0f
+ << 0.0f << 0.0f << 0.25f;
+
+ QTest::newRow("sample_2") << -5.0f << 8.0f << 4.0f
+ << 5.0f << -8.0f << 4.0f
+ << -1.0f << -1.0f << 1.0f;
+ }
+
+ void checkDivision()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, xA);
+ QFETCH(float, yA);
+ QFETCH(float, zA);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+ Vector3D_SSE v1(xA, yA, zA);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 / v1;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkDivisionFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << 0.0f << 2.0f
+ << 1.0f
+ << 0.0f << 0.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -1.0f << 4.0f << -5.0f;
+ }
+
+ void checkDivisionFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 / factor;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkMultiplicationFactor_data()
+ {
+ QTest::addColumn<float>("xO");
+ QTest::addColumn<float>("yO");
+ QTest::addColumn<float>("zO");
+
+ QTest::addColumn<float>("factor");
+
+ QTest::addColumn<float>("xR");
+ QTest::addColumn<float>("yR");
+ QTest::addColumn<float>("zR");
+
+ QTest::newRow("sample_1") << 0.0f << -3.0f << 2.0f
+ << 1.0f
+ << 0.0f << -3.0f << 2.0f;
+
+ QTest::newRow("sample_2") << -5.0f << 20.0f << -25.0f
+ << 5.0f
+ << -25.0f << 100.0f << -125.0f;
+ }
+
+ void checkMultiplicationFactor()
+ {
+ QFETCH(float, xO);
+ QFETCH(float, yO);
+ QFETCH(float, zO);
+
+ QFETCH(float, factor);
+
+ QFETCH(float, xR);
+ QFETCH(float, yR);
+ QFETCH(float, zR);
+
+ // GIVEN
+ Vector3D_SSE v0(xO, yO, zO);
+
+ // WHEN
+ Vector3D_SSE v2 = v0 * factor;
+
+ // THEN
+ QCOMPARE(v2.x(), xR);
+ QCOMPARE(v2.y(), yR);
+ QCOMPARE(v2.z(), zR);
+ }
+
+ void checkEquality()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0;
+ Vector3D_SSE v1;
+
+ // THEN
+ QVERIFY(v0 == v1);
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(1.0f, 2.0f, -5.0f);
+ Vector3D_SSE v1(1.0f, 2.0f, -5.0f);
+
+ // THEN
+ QVERIFY(v0 == v1);
+ }
+ }
+
+ void checkInequality()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0;
+ Vector3D_SSE v1;
+
+ // THEN
+ QVERIFY(!(v0 != v1));
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(1.0f, 2.0f, -5.0f);
+ Vector3D_SSE v1(1.0f, 5.0f, -5.0f);
+
+ // THEN
+ QVERIFY(v0 != v1);
+ }
+ }
+
+ void checkToQVector3D_SSE()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0;
+
+ // WHEN
+ QVector3D v1 = v0.toQVector3D();
+
+ // THEN
+ QCOMPARE(v0.x(), v1.x());
+ QCOMPARE(v0.y(), v1.y());
+ QCOMPARE(v0.z(), v1.z());
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(1.0f, 2.0f, -5.0f);
+
+ // WHEN
+ QVector3D v1 = v0.toQVector3D();
+
+ // THEN
+ QCOMPARE(v0.x(), v1.x());
+ QCOMPARE(v0.y(), v1.y());
+ QCOMPARE(v0.z(), v1.z());
+ }
+ }
+
+ void checkLengthSquared()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0(10.0f, 10.0f, 10.0f);
+
+ // THEN
+ QCOMPARE(v0.lengthSquared(), 300.0f);
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(3.0f, 1.0f, 2.0f);
+
+ // THEN
+ QCOMPARE(v0.lengthSquared(), 14.0f);
+ }
+ }
+
+ void checkLength()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0(3.0f, 0.0f, 0.0f);
+
+ // THEN
+ QCOMPARE(v0.length(), 3.0f);
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(0.0f, 10.0f, 0.0f);
+
+ // THEN
+ QCOMPARE(v0.length(), 10.0f);
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(0.0f, 0.0f, 9.0f);
+
+ // THEN
+ QCOMPARE(v0.length(), 9.0f);
+ }
+ }
+
+ void checkNormalize()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0(10.0f, 0.0f, 0.0f);
+
+ // WHEN
+ v0.normalize();
+
+ // THEN
+ QCOMPARE(v0, Vector3D_SSE(1.0f, 0.0f, 0.0f));
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(3.0f, 0.0f, 3.0f);
+
+ // WHEN
+ v0.normalize();
+
+ // THEN
+ // (0.707107 == sqrt(2) / 2)
+ Vector3D_SSE v2(0.707107f, 0.0f, 0.707107f);
+ QCOMPARE(qFuzzyCompare(v0, v2), true);
+ }
+ }
+
+ void checkNormalized()
+ {
+
+ }
+
+ void checkIsNull()
+ {
+ {
+ // GIVEN
+ Vector3D_SSE v0;
+
+ // THEN
+ QVERIFY(v0.isNull());
+ }
+ {
+ // GIVEN
+ Vector3D_SSE v0(1.0f, 1.0f, 1.0f);
+
+ // THEN
+ QVERIFY(!v0.isNull());
+ }
+ }
+};
+
+QTEST_APPLESS_MAIN(tst_Vector3D_SSE)
+
+#include "tst_vector3d_sse.moc"
diff --git a/tests/auto/core/vector3d_sse/vector3d_sse.pro b/tests/auto/core/vector3d_sse/vector3d_sse.pro
new file mode 100644
index 000000000..6afc4a863
--- /dev/null
+++ b/tests/auto/core/vector3d_sse/vector3d_sse.pro
@@ -0,0 +1,8 @@
+TARGET = tst_vector3d_sse
+CONFIG += testcase simd
+QT += testlib 3dcore 3dcore-private
+
+SOURCES += \
+ tst_vector3d_sse.cpp
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2