22 lines
598 B
C++
Executable File
22 lines
598 B
C++
Executable File
#ifdef WITH_TESTS
|
|
|
|
#include "../Tests.h"
|
|
|
|
#include "../../geo/Angle.h"
|
|
|
|
TEST(Angle, calc) {
|
|
|
|
ASSERT_EQ(0, Angle::getDEG(0,0, +1,0)); // to the right
|
|
ASSERT_EQ(90, Angle::getDEG(0,0, 0,+1)); // upwards
|
|
ASSERT_EQ(180, Angle::getDEG(0,0, -1,0)); // to the left
|
|
ASSERT_EQ(270, Angle::getDEG(0,0, 0,-1)); // downwards
|
|
|
|
ASSERT_EQ(45, Angle::getDEG(0,0, +1,+1)); // to the upper right
|
|
ASSERT_EQ(135, Angle::getDEG(0,0, -1,+1)); // to the upper left
|
|
ASSERT_EQ(225, Angle::getDEG(0,0, -1,-1)); // to the lower left
|
|
ASSERT_EQ(315, Angle::getDEG(0,0, +1,-1)); // to the lower right
|
|
|
|
}
|
|
|
|
#endif
|