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

Function test_sphere

tests/geometry/test-basic-objects.cpp:226–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void test_sphere()
227{
228 const geode::Point2D origin{ { -1.0, -5.0 } };
229 const double radius{ 3 };
230 const geode::Sphere2D sphere{ origin, radius };
231
232 geode::Sphere2D sphere2{ sphere };
233 geode::OpenGeodeGeometryException::test(
234 sphere2.radius() == radius && sphere2.origin() == origin,
235 "Wrong result for sphere2" );
236
237 geode::Sphere2D sphere3{ std::move( sphere ) };
238 geode::OpenGeodeGeometryException::test(
239 sphere3.radius() == radius && sphere3.origin() == origin,
240 "Wrong result for sphere3" );
241
242 const geode::Point2D origin2{ { 1.0, 5.0 } };
243 const double radius2{ 30 };
244 geode::Sphere2D sphere4{ origin2, radius2 };
245 sphere4 = sphere2;
246 geode::OpenGeodeGeometryException::test(
247 sphere4.radius() == radius && sphere4.origin() == origin,
248 "Wrong result for sphere4" );
249
250 geode::Sphere2D sphere5{ origin2, radius2 };
251 sphere5 = std::move( sphere2 );
252 geode::OpenGeodeGeometryException::test(
253 sphere5.radius() == radius && sphere5.origin() == origin,
254 "Wrong result for sphere5" );
255}
256
257void test_circle()
258{

Callers 1

testFunction · 0.85

Calls 2

testFunction · 0.70
radiusMethod · 0.45

Tested by

no test coverage detected