for (int i=0;i<9;++i)
{
- equivalent &= (m1[i] != m2[i]);
+ equivalent &= (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i]));
}
if (!equivalent)
{
int result = EXIT_STATUS_TESTCASE_FAILED;
- try
+// dont want to catch exception as we want to be able to get
+// gdb stack trace from the first error
+// by default tests should all always pass with no exceptions
+ if( testCase.startup )
{
- if( testCase.startup )
- {
- testCase.startup();
- }
- result = testCase.function();
- if( testCase.cleanup )
- {
- testCase.cleanup();
- }
+ testCase.startup();
}
- catch (...)
+ result = testCase.function();
+ if( testCase.cleanup )
{
- printf("Caught exception in test case.\n");
- result = EXIT_STATUS_TESTCASE_ABORTED;
+ testCase.cleanup();
}
return result;
}
+
int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
{
int testResult = EXIT_STATUS_TESTCASE_FAILED;
// @ 50%, will be at M_PI/3 around z
q = Quaternion::Slerp( q1, q2, 0.5f );
- Quaternion r( Dali::ANGLE_120, Vector3( 0.0f, 0.0f, 1.0f));
+ Quaternion r( Dali::ANGLE_60, Vector3( 0.0f, 0.0f, 1.0f));
DALI_TEST_EQUALS( q, r, 0.001, TEST_LOCATION );
END_TEST;
}
// Positive test case for constructors
int UtcDaliRadianConstructors01(void)
{
- TestApplication application;
-
// Default constructor, does not initialise the value
Radian radian0( 0.0f );
// Positive test case for comparison
int UtcDaliRadianComparison01(void)
{
- TestApplication application;
-
// Comparison between radians
Radian radian0( Math::PI_2 );
Radian radian1( Math::PI_2 );
// test case for cast operators
int UtcDaliRadianCastOperators01(void)
{
- TestApplication application; // Exceptions require TestApplication
-
Radian radian0( Math::PI );
const float& value0( radian0.radian );
int UtcDaliRadianCastOperatorEquals(void)
{
- TestApplication application;
-
Radian a(Math::PI_2);
Radian b(Math::PI_2);
Radian c(Math::PI);
int UtcDaliRadianCastOperatorNotEquals(void)
{
- TestApplication application;
-
Radian a(Math::PI_2);
Radian b(Math::PI_2);
Radian c(Math::PI);
int UtcDaliRadianCastOperatorLessThan(void)
{
- TestApplication application;
-
Radian a(Math::PI_4);
Radian b(Math::PI_2);
Radian c(Math::PI);
// compiler generated destructor, copy constructor and assignment operators are ok as this class is POD
// useful constant angles
-static const Radian ANGLE_360 = Radian( Math::PI * 2.00f ); ///< 360 degree turn in radians
-static const Radian ANGLE_315 = Radian( Math::PI * 1.75f ); ///< 315 degree turn in radians
-static const Radian ANGLE_270 = Radian( Math::PI * 1.50f );///< 270 degree turn in radians
-static const Radian ANGLE_225 = Radian( Math::PI * 1.25f ); ///< 225 degree turn in radians
-static const Radian ANGLE_180 = Radian( Math::PI ); ///< 180 degree turn in radians
-static const Radian ANGLE_135 = Radian( Math::PI * 0.75f ); ///< 135 degree turn in radians
-static const Radian ANGLE_120 = Radian( Math::PI / 3.00f ); ///< 120 degree turn in radians
-static const Radian ANGLE_90 = Radian( Math::PI_2 ); ///< 90 degree turn in radians
-static const Radian ANGLE_45 = Radian( Math::PI_4 ); ///< 45 degree turn in radians
-static const Radian ANGLE_30 = Radian( Math::PI / 6.00f ); ///< 30 degree turn in radians
-static const Radian ANGLE_0 = Radian( 0.0f ); ///< 0 degree turn in radians
+static const Radian ANGLE_360 = Radian( Math::PI * 2.f ); ///< 360 degree turn in radians
+static const Radian ANGLE_315 = Radian( Math::PI * 1.75f ); ///< 315 degree turn in radians
+static const Radian ANGLE_270 = Radian( Math::PI * 1.50f ); ///< 270 degree turn in radians
+static const Radian ANGLE_225 = Radian( Math::PI * 1.25f ); ///< 225 degree turn in radians
+static const Radian ANGLE_180 = Radian( Math::PI ); ///< 180 degree turn in radians
+static const Radian ANGLE_135 = Radian( Math::PI * 0.75f ); ///< 135 degree turn in radians
+static const Radian ANGLE_120 = Radian( Math::PI * 2.f/3.f ); ///< 120 degree turn in radians
+static const Radian ANGLE_90 = Radian( Math::PI_2 ); ///< 90 degree turn in radians
+static const Radian ANGLE_45 = Radian( Math::PI_4 ); ///< 45 degree turn in radians
+static const Radian ANGLE_60 = Radian( Math::PI / 3.f ); ///< 60 degree turn in radians
+static const Radian ANGLE_30 = Radian( Math::PI / 6.f ); ///< 30 degree turn in radians
+static const Radian ANGLE_0 = Radian( 0.0f ); ///< 0 degree turn in radians
/**
* @brief Compare equality between two radians.