SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
RadiansTests.cpp
1 #include "gtest/gtest.h"
2 
3 #include "SUAPI-CppWrapper/Geometry.hpp"
4 
5 
6 TEST(Radians, InitializeWithinRange)
7 {
8  CW::Radians radians(1.0);
9  ASSERT_DOUBLE_EQ(1.0, radians);
10 }
11 
12 TEST(Radians, InitializeRollAroundPositive)
13 {
14  CW::Radians radians(7.0);
15  auto expected = 0.71681469282041377;
16  ASSERT_DOUBLE_EQ(expected, radians);
17 }
18 
19 TEST(Radians, InitializeRollAroundNegative)
20 {
21  // Radians always produces a positive number between 0 and 2*PI. A negative
22  // number will be converted to its positive equivalent. So 5.5663706143591725
23  // is the same as -0.71681469282041377
24  CW::Radians radians(-7.0);
25  auto expected = 5.5663706143591725;
26  ASSERT_DOUBLE_EQ(expected, radians);
27 }
28