|
Revision 6879, 1.4 kB
(checked in by robert, 6 years ago)
|
|
Added support for using quat_scaled sx sy sz for testing getting quats from scaled
matrices. Removed broken Matrixd/quat test
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #include "UnitTestFramework.h" |
|---|
| 2 | |
|---|
| 3 | #include <osg/Matrixd> |
|---|
| 4 | #include <osg/Vec3> |
|---|
| 5 | #include <sstream> |
|---|
| 6 | |
|---|
| 7 | namespace osg |
|---|
| 8 | { |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | class Vec3TestFixture |
|---|
| 16 | { |
|---|
| 17 | public: |
|---|
| 18 | |
|---|
| 19 | Vec3TestFixture(); |
|---|
| 20 | |
|---|
| 21 | void testAddition(const osgUtx::TestContext& ctx); |
|---|
| 22 | void testSubtraction(const osgUtx::TestContext& ctx); |
|---|
| 23 | void testScalarMultiplication(const osgUtx::TestContext& ctx); |
|---|
| 24 | void testDotProduct(const osgUtx::TestContext& ctx); |
|---|
| 25 | |
|---|
| 26 | private: |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | Vec3 v1_, v2_, v3_; |
|---|
| 30 | |
|---|
| 31 | }; |
|---|
| 32 | |
|---|
| 33 | Vec3TestFixture::Vec3TestFixture(): |
|---|
| 34 | v1_(1.0f, 1.0f, 1.0f), |
|---|
| 35 | v2_(2.0f, 2.0f, 2.0f), |
|---|
| 36 | v3_(3.0f, 3.0f, 3.0f) |
|---|
| 37 | { |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | void Vec3TestFixture::testAddition(const osgUtx::TestContext&) |
|---|
| 41 | { |
|---|
| 42 | OSGUTX_TEST_F( v1_ + v2_ == v3_ ) |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | void Vec3TestFixture::testSubtraction(const osgUtx::TestContext&) |
|---|
| 46 | { |
|---|
| 47 | OSGUTX_TEST_F( v3_ - v1_ == v2_ ) |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | void Vec3TestFixture::testScalarMultiplication(const osgUtx::TestContext&) |
|---|
| 51 | { |
|---|
| 52 | OSGUTX_TEST_F( v1_ * 3 == v3_ ) |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | void Vec3TestFixture::testDotProduct(const osgUtx::TestContext&) |
|---|
| 56 | { |
|---|
| 57 | |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | OSGUTX_BEGIN_TESTSUITE(Vec3) |
|---|
| 61 | OSGUTX_ADD_TESTCASE(Vec3TestFixture, testAddition) |
|---|
| 62 | OSGUTX_ADD_TESTCASE(Vec3TestFixture, testSubtraction) |
|---|
| 63 | OSGUTX_ADD_TESTCASE(Vec3TestFixture, testScalarMultiplication) |
|---|
| 64 | OSGUTX_ADD_TESTCASE(Vec3TestFixture, testDotProduct) |
|---|
| 65 | OSGUTX_END_TESTSUITE |
|---|
| 66 | |
|---|
| 67 | OSGUTX_AUTOREGISTER_TESTSUITE_AT(Vec3, root.osg) |
|---|
| 68 | |
|---|
| 69 | } |
|---|