| 224 | } |
| 225 | |
| 226 | void 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 | |
| 257 | void test_circle() |
| 258 | { |