MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_arithmetic

Function test_arithmetic

tests/geometry/test-angle.cpp:115–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void test_arithmetic()
116{
117 auto angle30 = geode::Angle::create_from_degrees( 30 );
118 auto angle60 = geode::Angle::create_from_degrees( 60 );
119 auto sum = angle30 + angle60;
120 geode::OpenGeodeGeometryException::test(
121 sum == geode::Angle::create_from_degrees( 90 ),
122 "Wrong sum of angles !" );
123 auto diff = angle60 - angle30;
124 geode::OpenGeodeGeometryException::test(
125 diff == angle30, "Wrong diff of angles !" );
126 auto scaled = angle30 * 2;
127 geode::OpenGeodeGeometryException::test(
128 scaled == angle60, "Wrong scale angle !" );
129 auto divided = angle60 / 2;
130 geode::OpenGeodeGeometryException::test(
131 divided == angle30, "Wrong divided angle !" );
132}
133
134void test_normalization()
135{

Callers 1

testFunction · 0.70

Calls 1

testFunction · 0.70

Tested by

no test coverage detected