Making some functions in Vector use the new 'OperationType'.

This commit is contained in:
David Williams
2012-11-29 18:16:32 +01:00
parent b10b995a84
commit a026546bb4
3 changed files with 17 additions and 17 deletions

View File

@ -32,7 +32,7 @@ using namespace PolyVox;
void TestVector::testLength()
{
Vector3DInt8 vec(3, 4, 5);
QCOMPARE(vec.lengthSquared(), double(3*3+4*4+5*5));
QCOMPARE(vec.lengthSquared(), int32_t(3*3+4*4+5*5)); // QCOMPARE is strict on types. For an int8 vector, the OperationType is int32_t.
}
void TestVector::testDotProduct()
@ -40,7 +40,7 @@ void TestVector::testDotProduct()
Vector3DInt8 vecxy(3, 4, 0);
Vector3DInt8 vecz(0, 0, 1);
QCOMPARE(vecxy.dot(vecz), int8_t(0)); //QCOMPARE is very strict on the types matching
QCOMPARE(vecxy.dot(vecz), int32_t(0)); // QCOMPARE is strict on types. For an int8 vector, the OperationType is int32_t .
}
void TestVector::testEquality()