summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step9/Tests/TestMathFunctions.cxx
blob: bda0bba90c9a1f3f5e0bdb1c445a7d51d6715063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <string>

#include <MathFunctions.h>

int main(int argc, char* argv[])
{
  if (argc < 2) {
    return -1;
  }

  std::string op(argv[1]);

  if (op == "add") {
    return mathfunctions::OpAdd(1.0, 1.0) != 2.0;
  } else if (op == "mul") {
    return mathfunctions::OpMul(5.0, 5.0) != 25.0;
  } else if (op == "sqrt") {
    return mathfunctions::sqrt(25.0) != 5.0;
  } else if (op == "sub") {
    return mathfunctions::OpSub(5.0, 1.0) != 4.0;
  }

  return -1;
}