# | Line 194 | Line 194 | void VectorTestCase::testAccessEntries(){ | |
---|---|---|
194 | //test () operator | |
195 | CPPUNIT_ASSERT_DOUBLES_EQUAL(v3(0) , 4.0, oopse::epsilon); | |
196 | ||
197 | + | Vec4 a1; |
198 | + | double *pa1 = a1.getArrayPointer(); |
199 | + | |
200 | + | pa1[0] = 4.0; |
201 | + | pa1[1] = 1.0; |
202 | + | pa1[2] = 3.0; |
203 | + | pa1[3] = 2.0; |
204 | + | |
205 | + | CPPUNIT_ASSERT(a1 == v3); |
206 | } | |
207 | ||
208 | void VectorTestCase::testOtherMemberFunctions(){ | |
# | Line 218 | Line 227 | void VectorTestCase::testOtherMemberFunctions(){ | |
227 | //test isNormalized(); | |
228 | CPPUNIT_ASSERT(a1.isNormalized()); | |
229 | CPPUNIT_ASSERT(!one.isNormalized()); | |
221 | – | |
230 | ||
231 | + | //test getArray |
232 | + | double tempV[4]; |
233 | + | v3.getArray(tempV); |
234 | + | CPPUNIT_ASSERT_DOUBLES_EQUAL(tempV[0], v3[0], oopse::epsilon); |
235 | + | CPPUNIT_ASSERT_DOUBLES_EQUAL(tempV[1], v3[1], oopse::epsilon); |
236 | + | CPPUNIT_ASSERT_DOUBLES_EQUAL(tempV[2], v3[2], oopse::epsilon); |
237 | + | CPPUNIT_ASSERT_DOUBLES_EQUAL(tempV[3], v3[3], oopse::epsilon); |
238 | } | |
239 | void VectorTestCase::testOtherTemplateFunctions(){ | |
240 | //test dot |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |