sanyaade-g2g-repos / quimeraengine

Automatically exported from code.google.com/p/quimeraengine
0 stars 1 forks source link

Unit Tests: SQAngle #242

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Implementación de unit tests para las clases:

-QAngle
-QPoint

Original issue reported on code.google.com by Lince3D@gmail.com on 1 Feb 2012 at 6:42

GoogleCodeExporter commented 8 years ago
Ahora sólo inclute SQAngle.

Original comment by Lince3D@gmail.com on 10 Mar 2012 at 1:19

GoogleCodeExporter commented 8 years ago

Original comment by Lince3D@gmail.com on 4 Apr 2012 at 2:29

GoogleCodeExporter commented 8 years ago

Original comment by Lince3D@gmail.com on 4 Apr 2012 at 3:25

GoogleCodeExporter commented 8 years ago
- En estos tests creo que te confundes. El valor esperado debería ser 45º o 
SQAngle::Quarter_Pi, supongo que por eso cogiste 405º. Bueno, al menos el 
objetivo del método debería ser ese.

/// <summary>
/// Checks that a value greater than 360º is truncated to the equivalent value 
lower than 360º.
/// </summary>
QTEST_CASE ( TruncateDegrees_AnglesGreaterThan360AreCorrectlyTruncated_Test )
{
    // Preparation
    const float_q DEGREES = (float_q)405.0f;
    const float_q EXPECTED_VALUE = SQAngle::_360;

    // Execution
    float_q fResultUT = SQAngle::TruncateDegrees(DEGREES);

    // Verification
    BOOST_CHECK_EQUAL(fResultUT, EXPECTED_VALUE);
}

// <summary>
/// Checks that a value greater than 2 Pi is truncated to the equivalent value 
lower than 2 Pi.
/// </summary>
QTEST_CASE ( TruncateRadians_AnglesGreaterThan2PiAreCorrectlyTruncated_Test )
{
    // Preparation
    const float_q RADIANS = SQAngle::_2Pi + SQAngle::_QuarterPi;
    const float_q EXPECTED_VALUE = SQAngle::_2Pi;

    // Execution
    float_q fResultUT = SQAngle::TruncateRadians(RADIANS);

    // Verification
    BOOST_CHECK_EQUAL(fResultUT, EXPECTED_VALUE);
}

Original comment by jwl...@gmail.com on 25 Apr 2012 at 9:14