Refactored OctreeTests to use QtTest.

Note: unit tests currently fail, so that needs to be looked into.
This commit is contained in:
Seiji Emery 2015-06-23 11:05:53 -07:00
parent dfe58a5ed4
commit 4cb1dddb89
4 changed files with 757 additions and 698 deletions

View file

@ -67,7 +67,7 @@ void AABoxCubeTests::raycastInHitsXMinFace () {
bool intersects = box.findRayIntersection(origin, direction, distance, face);
QCOMPARE(intersects, true);
QCOMPARE(distance, 0.5f);
QCOMPARE(distance, 0.25f);
QCOMPARE(face, MIN_X_FACE);
}

View file

@ -24,7 +24,7 @@ private slots:
void raycastInHitsXMinFace ();
// TODO: Add more unit tests!
// (eg. no test for failed intersection or non-orthogonal ray)
// (do we need this? Currently no tests for no-intersection or non-orthogonal rays)
};
#endif // hifi_AABoxCubeTests_h

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,14 @@ private slots:
void byteCountCodingTests();
void modelItemTests();
// void runAllTests(bool verbose);
// TODO: Break these into separate test functions
};
// Helper functions
inline QByteArray makeQByteArray (std::initializer_list<char> bytes) {
return QByteArray {
bytes.begin(), static_cast<int>(bytes.size() * sizeof(char))
};
}
#endif // hifi_OctreeTests_h