2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include <dali/public-api/dali-core.h>
23 #include <dali-test-suite-utils.h>
28 void utc_dali_matrix_startup(void)
30 test_return_value = TET_UNDEF;
33 void utc_dali_matrix_cleanup(void)
35 test_return_value = TET_PASS;
39 int UtcDaliMatrixConstructor01P(void)
41 // State of memory cannot be guaranteed, so use
42 // a buffer in a known state to check for changes
43 char buffer[sizeof(Matrix)];
45 memset(buffer, 1, sizeof(Matrix));
47 Matrix* m2 = new(&buffer) Matrix(false);
48 bool initialisation_occured = false;
50 float* els = m2->AsFloat();
51 for(size_t idx=0; idx<16; ++idx, ++els)
54 initialisation_occured = true;
58 DALI_TEST_EQUALS(initialisation_occured, false, TEST_LOCATION);
63 int UtcDaliMatrixConstructor02P(void)
65 float r[] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f};
68 float* els = m.AsFloat();
70 bool initialised = true;
71 for(size_t idx=0; idx<16; ++idx, ++els, ++init)
76 DALI_TEST_EQUALS(initialised, true, TEST_LOCATION);
81 int UtcDaliMatrixConstructor03P(void)
83 float r[] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f};
88 float* els = ma.AsFloat();
89 float* init = mb.AsFloat();
90 bool initialised = true;
91 for(size_t idx=0; idx<16; ++idx, ++els, ++init)
96 DALI_TEST_EQUALS(initialised, true, TEST_LOCATION);
101 int UtcDaliMatrixConstructor04P(void)
103 Quaternion q(Quaternion::IDENTITY);
105 DALI_TEST_EQUALS(Matrix(Matrix::IDENTITY), m, 0.001, TEST_LOCATION);
109 int UtcDaliMatrixCopyConstructor(void)
111 Matrix m0( Matrix::IDENTITY );
113 DALI_TEST_EQUALS(m1, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
118 int UtcDaliMatrixMoveConstructor(void)
120 Matrix m0( Matrix::IDENTITY );
121 Matrix m1 = std::move( m0 );
122 DALI_TEST_EQUALS(m1, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
127 int UtcDaliMatrixCopyAssignment(void)
129 Matrix m0( Matrix::IDENTITY );
132 DALI_TEST_EQUALS(m1, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
137 int UtcDaliMatrixMoveAssignment(void)
139 Matrix m0( Matrix::IDENTITY );
141 m1 = std::move( m0 );
142 DALI_TEST_EQUALS(m1, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
147 int UtcDaliMatrixAssignP(void)
149 Matrix a(Matrix::IDENTITY);
151 DALI_TEST_EQUALS(a, b, 0.001, TEST_LOCATION);
155 int UtcDaliMatrixAssign02P(void)
157 Matrix a(Matrix::IDENTITY);
158 a = a; // self assign does the do nothing branch
159 DALI_TEST_EQUALS(Matrix(Matrix::IDENTITY), a, 0.001, TEST_LOCATION);
163 int UtcDaliMatrixSetIdentityP(void)
165 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
166 4.0f, 5.0f, 6.0f, 7.0f,
167 8.0f, 9.0f, 10.0f, 11.0f,
168 12.0f, 13.0f, 14.0f, 15.0f };
172 DALI_TEST_EQUALS(m, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
176 int UtcDaliMatrixSetIdentityAndScaleP(void)
178 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
179 4.0f, 5.0f, 6.0f, 7.0f,
180 8.0f, 9.0f, 10.0f, 11.0f,
181 12.0f, 13.0f, 14.0f, 15.0f };
183 m.SetIdentityAndScale(Vector3(4.0f, 4.0f, 4.0f));
185 float els2[] = { 4.0f, 0.0f, 0.0f, 0.0f,
186 0.0f, 4.0f, 0.0f, 0.0f,
187 0.0f, 0.0f, 4.0f, 0.0f,
188 0.0f, 0.0f, 0.0f, 1.0f };
191 DALI_TEST_EQUALS(m, r, 0.001f, TEST_LOCATION);
195 int UtcDaliMatrixInvertTransformP(void)
197 for (int i=0;i<1000;++i)
200 Vector3 axis(cosf(f*0.001f), cosf(f*0.02f), cosf(f*0.03f));
202 Vector3 center(f, cosf(f) * 100.0f, cosf(f*0.5f) * 50.0f);
206 m0.SetTransformComponents( Vector3::ONE, Quaternion(Radian(1.0f), axis), center );
209 m0.InvertTransform(m1);
212 Matrix::Multiply( m2, m0, m1 );
214 DALI_TEST_EQUALS(m2, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
219 int UtcDaliMatrixInvertTransformN(void)
221 std::string exceptionString( "EqualsZero( mMatrix[3] ) && EqualsZero( mMatrix[7] ) && EqualsZero( mMatrix[11] ) && Equals( mMatrix[15], 1.0f" );
224 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
225 4.0f, 5.0f, 6.0f, 7.0f,
226 8.0f, 9.0f, 10.0f, 11.0f,
227 12.0f, 13.0f, 14.0f, 15.0f };
231 m.InvertTransform(it);
232 tet_result(TET_FAIL);
234 catch (Dali::DaliException& e)
236 DALI_TEST_PRINT_ASSERT( e );
237 DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
242 float els[] = { 0.0f, 1.0f, 2.0f, 0.0f,
243 4.0f, 5.0f, 6.0f, 7.0f,
244 8.0f, 9.0f, 10.0f, 11.0f,
245 12.0f, 13.0f, 14.0f, 15.0f };
249 m.InvertTransform(it);
250 tet_result(TET_FAIL);
252 catch (Dali::DaliException& e)
254 DALI_TEST_PRINT_ASSERT( e );
255 DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
260 float els[] = { 0.0f, 1.0f, 2.0f, 0.0f,
261 4.0f, 5.0f, 6.0f, 0.0f,
262 8.0f, 9.0f, 10.0f, 11.0f,
263 12.0f, 13.0f, 14.0f, 15.0f };
267 m.InvertTransform(it);
268 tet_result(TET_FAIL);
270 catch (Dali::DaliException& e)
272 DALI_TEST_PRINT_ASSERT( e );
273 DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
278 float els[] = { 0.0f, 1.0f, 2.0f, 0.0f,
279 4.0f, 5.0f, 6.0f, 0.0f,
280 8.0f, 9.0f, 10.0f, 0.0f,
281 12.0f, 13.0f, 14.0f, 15.0f };
285 m.InvertTransform(it);
286 tet_result(TET_FAIL);
288 catch (Dali::DaliException& e)
290 DALI_TEST_PRINT_ASSERT( e );
291 DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
296 int UtcDaliMatrixInvert01P(void)
298 // We're going to invert a whole load of different matrices to make sure we don't
299 // fail on particular orientations.
300 for (int i=0;i<1000;++i)
303 Vector3 axis(cosf(f*0.001f), cosf(f*0.02f), cosf(f*0.03f));
305 Vector3 center(f, cosf(f) * 100.0f, cosf(f*0.5f) * 50.0f);
309 m0.SetTransformComponents( Vector3::ONE, Quaternion(Radian(1.0f), axis), center );
315 Matrix::Multiply( m2, m0, m1 );
317 DALI_TEST_EQUALS(m2, Matrix::IDENTITY, 0.001f, TEST_LOCATION);
319 m1.Invert(); // doube invert - should be back to m0
321 DALI_TEST_EQUALS(m0, m1, 0.001f, TEST_LOCATION);
326 int UtcDaliMatrixInvert02P(void)
328 Matrix m1 = Matrix::IDENTITY;
329 m1.SetXAxis(Vector3(0.0f, 0.0f, 0.0f));
330 DALI_TEST_EQUALS(m1.Invert(), false, TEST_LOCATION);
334 int UtcDaliMatrixTransposeP(void)
337 { 0.0f, 1.0f, 2.0f, 3.0f,
338 4.0f, 5.0f, 6.0f, 7.0f,
339 8.0f, 9.0f, 10.0f, 11.0f,
340 12.0f, 13.0f, 14.0f, 15.0f
348 for (int x=0;x<4;++x)
350 for (int y=0;y<4;++y)
352 success &= (m.AsFloat()[x+y*4] == floats[x*4+y]);
356 DALI_TEST_CHECK(success);
360 int UtcDaliMatrixGetXAxisP(void)
362 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
363 4.0f, 5.0f, 6.0f, 7.0f,
364 8.0f, 9.0f, 10.0f, 11.0f,
365 12.0f, 13.0f, 14.0f, 15.0f };
368 DALI_TEST_CHECK(m.GetXAxis() == Vector3(0.0f, 1.0f, 2.0f));
372 int UtcDaliMatrixGetYAxisP(void)
374 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
375 4.0f, 5.0f, 6.0f, 7.0f,
376 8.0f, 9.0f, 10.0f, 11.0f,
377 12.0f, 13.0f, 14.0f, 15.0f };
380 DALI_TEST_CHECK(m.GetYAxis() == Vector3(4.0f, 5.0f, 6.0f));
384 int UtcDaliMatrixGetZAxisP(void)
386 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
387 4.0f, 5.0f, 6.0f, 7.0f,
388 8.0f, 9.0f, 10.0f, 11.0f,
389 12.0f, 13.0f, 14.0f, 15.0f };
392 DALI_TEST_CHECK(m.GetZAxis() == Vector3(8.0f, 9.0f, 10.0f));
396 int UtcDaliMatrixSetXAxisP(void)
399 Vector3 v(2.0f, 3.0f, 4.0f);
402 DALI_TEST_CHECK(m.GetXAxis() == v);
406 int UtcDaliMatrixSetYAxisP(void)
409 Vector3 v(2.0f, 3.0f, 4.0f);
412 DALI_TEST_CHECK(m.GetYAxis() == v);
416 int UtcDaliMatrixSetZAxisP(void)
419 Vector3 v(2.0f, 3.0f, 4.0f);
422 DALI_TEST_CHECK(m.GetZAxis() == v);
426 int UtcDaliMatrixGetTranslationP(void)
428 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
429 4.0f, 5.0f, 6.0f, 7.0f,
430 8.0f, 9.0f, 10.0f, 11.0f,
431 12.0f, 13.0f, 14.0f, 15.0f };
434 DALI_TEST_EQUALS(m.GetTranslation(), Vector4(12.0f, 13.0f, 14.0f, 15.0f), TEST_LOCATION);
438 int UtcDaliMatrixGetTranslation3P(void)
440 float els[] = { 0.0f, 1.0f, 2.0f, 3.0f,
441 4.0f, 5.0f, 6.0f, 7.0f,
442 8.0f, 9.0f, 10.0f, 11.0f,
443 12.0f, 13.0f, 14.0f, 15.0f };
446 DALI_TEST_EQUALS(m.GetTranslation3(), Vector3(12.0f, 13.0f, 14.0f), TEST_LOCATION);
450 int UtcDaliMatrixSetTranslationP(void)
453 Vector4 v(2.0f, 3.0f, 4.0f, 5.0f);
456 DALI_TEST_CHECK(m.GetTranslation() == v);
460 int UtcDaliMatrixSetTranslation3P(void)
463 Vector3 v(2.0f, 3.0f, 4.0f);
466 DALI_TEST_CHECK(m.GetTranslation3() == v);
470 int UtcDaliMatrixOrthoNormalize0P(void)
472 // OrthoNormalise fixes floating point errors from matrix rotations
476 for (int i=0;i<1000;++i)
479 Vector3 axis(cosf(f*0.001f), cosf(f*0.02f), cosf(f*0.03f));
482 m.SetTransformComponents( Vector3::ONE, Quaternion(Radian(1.0f), axis), Vector3::ZERO );
487 success &= fabsf(m.GetXAxis().Dot(m.GetYAxis())) < 0.001f;
488 success &= fabsf(m.GetYAxis().Dot(m.GetXAxis())) < 0.001f;
489 success &= fabsf(m.GetZAxis().Dot(m.GetYAxis())) < 0.001f;
491 success &= fabsf(m.GetXAxis().Length() - 1.0f) < 0.001f;
492 success &= fabsf(m.GetYAxis().Length() - 1.0f) < 0.001f;
493 success &= fabsf(m.GetZAxis().Length() - 1.0f) < 0.001f;
495 DALI_TEST_CHECK(success);
499 int UtcDaliMatrixOrthoNormalize1P(void)
501 // OrthoNormalize is not flipping the axes and is maintaining the translation
502 for (int i=0;i<1000;++i)
505 Vector3 axis(cosf(f*0.001f), cosf(f*0.02f), cosf(f*0.03f));
507 Vector3 center(10.0f, 15.0f, 5.0f);
511 m0.SetTransformComponents( Vector3::ONE, Quaternion(Radian(1.0f), axis), center );
516 DALI_TEST_EQUALS(m0.GetXAxis(), m1.GetXAxis(), 0.001f, TEST_LOCATION);
517 DALI_TEST_EQUALS(m0.GetYAxis(), m1.GetYAxis(), 0.001f, TEST_LOCATION);
518 DALI_TEST_EQUALS(m0.GetZAxis(), m1.GetZAxis(), 0.001f, TEST_LOCATION);
519 DALI_TEST_EQUALS(m0.GetTranslation(), m1.GetTranslation(), 0.001f, TEST_LOCATION);
524 int UtcDaliMatrixConstAsFloatP(void)
526 float r[] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f};
529 const float* els = m.AsFloat();
530 const float* init = r;
531 bool initialised = true;
532 for(size_t idx=0; idx<16; ++idx, ++els, ++init)
537 DALI_TEST_EQUALS(initialised, true, TEST_LOCATION);
543 int UtcDaliMatrixAsFloatP(void)
545 float r[] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f};
548 float* els = m.AsFloat();
550 bool initialised = true;
551 for(size_t idx=0; idx<16; ++idx, ++els, ++init)
556 DALI_TEST_EQUALS(initialised, true, TEST_LOCATION);
562 int UtcDaliMatrixMultiplyP(void)
564 Matrix m1 = Matrix::IDENTITY;
566 float els[] = { 1.0f, 0.0f, 0.0f, 0.0f,
567 0.0f, 0.707f, 0.707f, 0.0f,
568 0.0f, -0.707f, 0.707f, 0.0f,
569 0.0f, 0.0f, 0.0f, 1.0f };
572 Quaternion q(Radian(Degree(45.0f)), Vector3::XAXIS);
574 Matrix::Multiply(m2, m1, q);
576 DALI_TEST_EQUALS(m2, result, 0.01f, TEST_LOCATION);
580 int UtcDaliMatrixOperatorMultiply01P(void)
582 Vector4 v1(2.0f, 5.0f, 4.0f, 0.0f);
584 float els[] = {2.0f, 0.0f, 0.0f, 0.0f,
585 0.0f, 3.0f, 0.0f, 0.0f,
586 0.0f, 0.0f, 4.0f, 0.0f,
587 0.0f, 0.0f, 0.0f, 1.0f };
590 Vector4 v2 = m1 * v1;
591 Vector4 r1(4.0f, 15.0f, 16.0f, 0.0f);
592 DALI_TEST_EQUALS(v2, r1, 0.01f, TEST_LOCATION);
596 int UtcDaliMatrixOperatorMultiply02P(void)
598 TestApplication application;
600 Vector3 position ( 30.f, 40.f, 50.f);
604 m1.SetTranslation(-position);
606 Vector4 positionV4(position);
608 Vector4 output = m1 * positionV4;
611 DALI_TEST_EQUALS(output, Vector4::ZERO, 0.01f, TEST_LOCATION);
615 int UtcDaliMatrixOperatorEqualsP(void)
617 Matrix m1 = Matrix::IDENTITY;
619 float els[] = { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
621 DALI_TEST_EQUALS(m1 == r2, true, TEST_LOCATION);
623 float *f = m1.AsFloat();
624 for(size_t i=0; i<16; i++)
627 DALI_TEST_EQUALS(m1 == r2, false, TEST_LOCATION);
632 int UtcDaliMatrixOperatorNotEqualsP(void)
634 Matrix m1 = Matrix::IDENTITY;
635 float els[] = {2.0f, 0.0f, 0.0f, 0.0f,
636 0.0f, 3.0f, 0.0f, 0.0f,
637 0.0f, 0.0f, 4.0f, 0.0f,
638 0.0f, 0.0f, 0.0f, 1.0f };
641 DALI_TEST_CHECK(m1 != r1);
642 DALI_TEST_CHECK(!(m1 != m1));
646 int UtcDaliMatrixSetTransformComponents01P(void)
648 // Create an arbitrary vector
649 for( float x=-1.0f; x<=1.0f; x+=0.1f )
651 for( float y=-1.0f; y<1.0f; y+=0.1f )
653 for( float z=-1.0f; z<1.0f; z+=0.1f )
655 Vector3 vForward(x, y, z);
656 vForward.Normalize();
658 for( float angle = 5.0f; angle <= 360.0f; angle += 15.0f)
660 Quaternion rotation1(Radian(Degree(angle)), vForward);
662 Matrix m1(rotation1);
663 Matrix result1(false);
664 Vector3 vForward3(vForward.x, vForward.y, vForward.z);
665 result1.SetTransformComponents( Vector3::ONE, Quaternion(Radian(Degree(angle)), vForward3), Vector3::ZERO );
667 DALI_TEST_EQUALS(m1, result1, 0.001, TEST_LOCATION);
670 m2.SetTransformComponents(vForward, Quaternion::IDENTITY, Vector3::ZERO);
672 Matrix result2a(Matrix::IDENTITY);
673 result2a.SetXAxis(result2a.GetXAxis() * vForward[0]);
674 result2a.SetYAxis(result2a.GetYAxis() * vForward[1]);
675 result2a.SetZAxis(result2a.GetZAxis() * vForward[2]);
677 DALI_TEST_EQUALS(m2, result2a, 0.001, TEST_LOCATION);
680 m3.SetTransformComponents(vForward, rotation1, Vector3::ZERO);
682 Matrix result3(Matrix::IDENTITY);
683 result3.SetXAxis(result3.GetXAxis() * vForward[0]);
684 result3.SetYAxis(result3.GetYAxis() * vForward[1]);
685 result3.SetZAxis(result3.GetZAxis() * vForward[2]);
687 Matrix::Multiply(result3, result3, m1);
688 DALI_TEST_EQUALS(m3, result3, 0.001, TEST_LOCATION);
696 int UtcDaliMatrixSetInverseTransformComponent01P(void)
698 // Create an arbitrary vector
699 for( float x=-1.0f; x<=1.0f; x+=0.1f )
701 for( float y=-1.0f; y<1.0f; y+=0.1f )
703 for( float z=-1.0f; z<1.0f; z+=0.1f )
705 Vector3 vForward(x, y, z);
706 vForward.Normalize();
709 Quaternion rotation1(Quaternion::IDENTITY); // test no rotation branch
710 Vector3 scale1(2.0f, 3.0f, 4.0f);
711 Vector3 position1(1.0f, 2.0f, 3.0f);
714 m1.SetTransformComponents(scale1, rotation1, position1);
717 m2.SetInverseTransformComponents(scale1, rotation1, position1);
720 Matrix::Multiply(result, m1, m2);
722 DALI_TEST_EQUALS(result, Matrix::IDENTITY, 0.001, TEST_LOCATION);
730 int UtcDaliMatrixSetInverseTransformComponent02P(void)
732 // Create an arbitrary vector
733 for( float x=-1.0f; x<=1.0f; x+=0.1f )
735 for( float y=-1.0f; y<1.0f; y+=0.1f )
737 for( float z=-1.0f; z<1.0f; z+=0.1f )
739 Vector3 vForward(x, y, z);
740 vForward.Normalize();
742 for( float angle = 5.0f; angle <= 360.0f; angle += 15.0f)
744 Quaternion rotation1(Radian(Degree(angle)), vForward);
745 Matrix rotationMatrix(rotation1); // TEST RELIES ON THIS METHOD WORKING!!!
747 Vector3 position1(5.0f, -6.0f, 7.0f);
750 m1.SetTransformComponents( Vector3::ONE, rotation1, position1 );
753 m2.SetInverseTransformComponents( rotationMatrix.GetXAxis(),
754 rotationMatrix.GetYAxis(),
755 rotationMatrix.GetZAxis(),
759 Matrix::Multiply(result, m1, m2);
761 DALI_TEST_EQUALS(result, Matrix::IDENTITY, 0.001, TEST_LOCATION);
769 int UtcDaliMatrixGetTransformComponents01P(void)
771 Matrix m2(Matrix::IDENTITY.AsFloat());
775 m2.GetTransformComponents(pos2, q2, scale2);
776 DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), pos2, 0.001, TEST_LOCATION);
777 DALI_TEST_EQUALS(Vector3(1.0f, 1.0f, 1.0f), scale2, 0.001, TEST_LOCATION);
778 DALI_TEST_EQUALS(Quaternion(), q2, 0.001, TEST_LOCATION);
783 int UtcDaliMatrixGetTransformComponents02P(void)
785 // Create an arbitrary vector
786 for( float x=-1.0f; x<=1.0f; x+=0.1f )
788 for( float y=-1.0f; y<1.0f; y+=0.1f )
790 for( float z=-1.0f; z<1.0f; z+=0.1f )
792 Vector3 vForward(x, y, z);
793 vForward.Normalize();
795 for( float angle = 5.0f; angle <= 360.0f; angle += 15.0f)
797 Quaternion rotation1(Radian(Degree(angle)), vForward);
798 Vector3 scale1(2.0f, 3.0f, 4.0f);
799 Vector3 position1(1.0f, 2.0f, 3.0f);
802 m1.SetTransformComponents(scale1, rotation1, position1);
805 Quaternion rotation2;
807 m1.GetTransformComponents(position2, rotation2, scale2);
809 DALI_TEST_EQUALS(position1, position2, 0.001, TEST_LOCATION);
810 DALI_TEST_EQUALS(scale1, scale2, 0.001, TEST_LOCATION);
811 DALI_TEST_EQUALS(rotation1, rotation2, 0.001, TEST_LOCATION);
819 int UtcDaliMatrixGetTransformComponents03P(void)
821 Matrix m2; // zero branch
825 m2.GetTransformComponents(pos2, q2, scale2);
826 DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), pos2, 0.001, TEST_LOCATION);
827 DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), scale2, 0.001, TEST_LOCATION);
828 // DALI_TEST_EQUALS(Quaternion(), q2, 0.001, TEST_LOCATION);
832 int UtcDaliMatrixOStreamOperator(void)
834 std::ostringstream oss;
837 matrix.SetIdentity();
841 std::string expectedOutput = "[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]";
843 DALI_TEST_EQUALS( oss.str(), expectedOutput, TEST_LOCATION);