| 70 |
|
//test /= |
| 71 |
|
tmp = two; |
| 72 |
|
tmp *= 2.0; |
| 73 |
< |
CPPUNIT_ASSERT(tmp == one); |
| 74 |
< |
//test / |
| 75 |
< |
CPPUNIT_ASSERT( two /2 == one); |
| 76 |
< |
CPPUNIT_ASSERT( two /4 == one * 0.5); |
| 73 |
> |
CPPUNIT_ASSERT(tmp == one * 4.0); |
| 74 |
|
|
| 75 |
+ |
//test / |
| 76 |
+ |
CPPUNIT_ASSERT( two /2.0 == one); |
| 77 |
+ |
CPPUNIT_ASSERT( two /4.0 == one * 0.5); |
| 78 |
+ |
|
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
void Vector3TestCase::testAccessEntries(){ |
| 82 |
|
|
| 83 |
< |
CPPUNIT_ASSERT(v1.z() == 3.0); |
| 84 |
< |
CPPUNIT_ASSERT(v2.x() == 4.0); |
| 85 |
< |
CPPUNIT_ASSERT(v3.y() == 10.0); |
| 83 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(v1.z(), 3.0, oopse::epsilon); |
| 84 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(v2.x(), 4.0, oopse::epsilon); |
| 85 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(v3.y(), 10.0, oopse::epsilon); |
| 86 |
|
|
| 87 |
|
Vector3d tmp; |
| 88 |
|
tmp.x() = 78.01; |
| 89 |
|
tmp.y() = 21.0; |
| 90 |
|
tmp.z() =133.12; |
| 91 |
< |
CPPUNIT_ASSERT(tmp[0] == 78.01 && tmp[1] == 21.0 && tmp[2] == 133.12); |
| 92 |
< |
|
| 91 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.x(), 78.01, oopse::epsilon); |
| 92 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.y(), 21.0, oopse::epsilon); |
| 93 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(tmp.z(), 133.12, oopse::epsilon); |
| 94 |
> |
|
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
void Vector3TestCase::testOtherTemplateFunctions(){ |