Cleaning up and documenting scmp code.

This commit is contained in:
2023-10-20 02:59:36 -07:00
parent 4eb4008130
commit b49caa3ec9
12 changed files with 343 additions and 108 deletions

View File

@@ -42,6 +42,11 @@ namespace geom {
//
// Point2D
Point2D::Point2D() : x(0), y(0) {}
Point2D::Point2D(int _x, int _y) : x(_x), y(_y) {}
Point2D::Point2D(const Polar2D &pol)
: x(std::rint(std::cos(pol.theta) * pol.r)),
y(std::rint(std::sin(pol.theta) * pol.r)) {}

View File

@@ -61,7 +61,7 @@ SimpleSuite::AddTest(std::string name, std::function<bool()> test)
void
SimpleSuite::AddFailingTest(std::string name, std::function<bool()> test)
{
const UnitTest test_case = {std::move(name), test, false};
const UnitTest test_case = {std::move(name), std::move(test), false};
tests.push_back(test_case);
}