TestMathFunctions.cxx 422 B

12345678910111213141516171819202122232425262728
  1. #include <MathFunctions.h>
  2. // TODO5: Replace the following 5 lines with #include <SimpleTest.h>
  3. #define TEST(x) namespace
  4. #define REQUIRE(x)
  5. int main()
  6. {
  7. }
  8. TEST("add")
  9. {
  10. REQUIRE(mathfunctions::OpAdd(2.0, 2.0) == 4.0);
  11. }
  12. TEST("sub")
  13. {
  14. REQUIRE(mathfunctions::OpSub(4.0, 2.0) == 2.0);
  15. }
  16. TEST("mul")
  17. {
  18. REQUIRE(mathfunctions::OpMul(5.0, 5.0) == 25.0);
  19. }
  20. TEST("sqrt")
  21. {
  22. REQUIRE(mathfunctions::sqrt(25.0) == 5.0);
  23. }