TestMathFunctions.cxx 316 B

12345678910111213141516171819202122
  1. #include <MathFunctions.h>
  2. #include <SimpleTest.h>
  3. TEST("add")
  4. {
  5. REQUIRE(mathfunctions::OpAdd(2.0, 2.0) == 4.0);
  6. }
  7. TEST("sub")
  8. {
  9. REQUIRE(mathfunctions::OpSub(4.0, 2.0) == 2.0);
  10. }
  11. TEST("mul")
  12. {
  13. REQUIRE(mathfunctions::OpMul(5.0, 5.0) == 25.0);
  14. }
  15. TEST("sqrt")
  16. {
  17. REQUIRE(mathfunctions::sqrt(25.0) == 5.0);
  18. }