Michaël Lemaire
0e0b39f576
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@555 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
31 lines
1.2 KiB
C
31 lines
1.2 KiB
C
#include "testing/common.h"
|
|
#include "rendering/tools/euclid.h"
|
|
|
|
START_TEST(test_euclid_angles)
|
|
{
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, 0.0), 0.0);
|
|
|
|
ck_assert_double_eq(euclidGet2DAngle(0.1, 0.0), 0.0);
|
|
ck_assert_double_eq(euclidGet2DAngle(1.0, 0.0), 0.0);
|
|
ck_assert_double_eq(euclidGet2DAngle(2.0, 0.0), 0.0);
|
|
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, 0.1), M_PI_2);
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, 1.0), M_PI_2);
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, 2.0), M_PI_2);
|
|
|
|
ck_assert_double_eq(euclidGet2DAngle(-0.1, 0.0), M_PI);
|
|
ck_assert_double_eq(euclidGet2DAngle(-1.0, 0.0), M_PI);
|
|
ck_assert_double_eq(euclidGet2DAngle(-2.0, 0.0), M_PI);
|
|
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, -0.1), 3.0 * M_PI_2);
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, -1.0), 3.0 * M_PI_2);
|
|
ck_assert_double_eq(euclidGet2DAngle(0.0, -2.0), 3.0 * M_PI_2);
|
|
|
|
ck_assert_double_eq(euclidGet2DAngle(0.5, 0.5), M_PI_4);
|
|
ck_assert_double_eq(euclidGet2DAngle(0.5, -0.5), 7.0 * M_PI_4);
|
|
ck_assert_double_eq(euclidGet2DAngle(-0.5, 0.5), 3.0 * M_PI_4);
|
|
ck_assert_double_eq(euclidGet2DAngle(-0.5, -0.5), 5.0 * M_PI_4);
|
|
}
|
|
END_TEST
|
|
|
|
TEST_CASE(euclid, test_euclid_angles)
|