+
+int UtcDaliMatrixGetTransformComponents01P(void)
+{
+ Matrix m2(Matrix::IDENTITY.AsFloat());
+ Vector3 pos2;
+ Vector3 scale2;
+ Quaternion q2;
+ m2.GetTransformComponents(pos2, q2, scale2);
+ DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), pos2, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(Vector3(1.0f, 1.0f, 1.0f), scale2, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(Quaternion(), q2, 0.001, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliMatrixGetTransformComponents02P(void)
+{
+ // Create an arbitrary vector
+ for(float x = -1.0f; x <= 1.0f; x += 0.1f)
+ {
+ for(float y = -1.0f; y < 1.0f; y += 0.1f)
+ {
+ for(float z = -1.0f; z < 1.0f; z += 0.1f)
+ {
+ Vector3 vForward(x, y, z);
+ vForward.Normalize();
+
+ for(float angle = 5.0f; angle <= 360.0f; angle += 15.0f)
+ {
+ Quaternion rotation1(Radian(Degree(angle)), vForward);
+ Vector3 scale1(2.0f, 3.0f, 4.0f);
+ Vector3 position1(1.0f, 2.0f, 3.0f);
+
+ Matrix m1(false);
+ m1.SetTransformComponents(scale1, rotation1, position1);
+
+ Vector3 position2;
+ Quaternion rotation2;
+ Vector3 scale2;
+ m1.GetTransformComponents(position2, rotation2, scale2);
+
+ DALI_TEST_EQUALS(position1, position2, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(scale1, scale2, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(rotation1, rotation2, 0.001, TEST_LOCATION);
+ }
+ }
+ }
+ }
+ END_TEST;
+}
+
+int UtcDaliMatrixGetTransformComponents03P(void)
+{
+ Matrix m2; // zero branch
+ Vector3 pos2;
+ Vector3 scale2;
+ Quaternion q2;
+ m2.GetTransformComponents(pos2, q2, scale2);
+ DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), pos2, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(Vector3(0.0f, 0.0f, 0.0f), scale2, 0.001, TEST_LOCATION);
+ // DALI_TEST_EQUALS(Quaternion(), q2, 0.001, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliMatrixOStreamOperator(void)
+{
+ std::ostringstream oss;
+
+ Matrix matrix;
+ matrix.SetIdentity();
+
+ oss << matrix;
+
+ std::string expectedOutput = "[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]";
+
+ DALI_TEST_EQUALS(oss.str(), expectedOutput, TEST_LOCATION);
+ END_TEST;
+}