|
@@ -168,6 +168,19 @@ static void testMul(Test& test) {
|
|
|
Vector3(1.0f, 2.0f, 3.0f) * 3.0, "mul 2");
|
|
|
}
|
|
|
|
|
|
+static void testSetDiv(Test& test) {
|
|
|
+ Vector3 v(12.0f, 24.0f, 9.0f);
|
|
|
+ v /= 3.0f;
|
|
|
+ compareVectors(test, Vector3(4.0f, 8.0f, 3.0f), v, "set div 1");
|
|
|
+ v /= -2.0f;
|
|
|
+ compareVectors(test, Vector3(-2.0f, -4.0f, -1.5f), v, "set div 2");
|
|
|
+}
|
|
|
+
|
|
|
+static void testDiv(Test& test) {
|
|
|
+ compareVectors(test, Vector3(-1.0f, -2.0f, -3.0f),
|
|
|
+ Vector3(-3.0f, -6.0f, -9.0f) / 3.0f, "div");
|
|
|
+}
|
|
|
+
|
|
|
static void testDot(Test& test) {
|
|
|
test.checkFloat(
|
|
|
9.0f, Vector3(-4.0f, 2.0f, -3.0f).dot(Vector3(-1.0f, -2.0f, -3.0f)),
|
|
@@ -223,6 +236,8 @@ void VectorTests::test() {
|
|
|
testInvert(test);
|
|
|
testSetMul(test);
|
|
|
testMul(test);
|
|
|
+ testSetDiv(test);
|
|
|
+ testDiv(test);
|
|
|
testDot(test);
|
|
|
testSquareLength(test);
|
|
|
testLength(test);
|