Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author Stephen Gilbert
- * @date CS 150 Testing Template
- */
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <cmath>
- #include <algorithm>
- #include <vector>
- #include <fstream>
- using namespace std;
- #include "cs150check.h"
- ///////////// Add header for function being tested
- #include "extreme.h"
- //////////// Add your student ID here
- string STUDENT = "dnguyen1515";
- const double EPSILON = 1.0e-14;
- void runTests()
- {
- srand(time(0));
- ///////////// Begin a set of tests
- beginTests(); // test heading
- /////// Tests for function //////////////////////
- beginFunctionTest("max"); // Test title
- assertDoubleEquals(5.2, ex::max(5.2, 3.6), EPSILON); // double
- assertDoubleEquals(5.2, ex::max(3.6, 5.2), EPSILON); // double
- assertDoubleEquals(5.2, ex::max(-17.0, 5.2), EPSILON); // double
- endFunctionTest(); // end
- beginFunctionTest("min"); // Test title
- assertDoubleEquals(3.6, ex::min(5.2, 3.6), EPSILON); // double
- assertDoubleEquals(3.6, ex::min(3.6, 5.2), EPSILON); // double
- assertDoubleEquals(-17.0, ex::min(-17.0, 5.2), EPSILON); // double
- endFunctionTest(); // end
- ///////// End all test runs /////////////////////////
- endTests();
- }
- //////////// Student tests or run
- int run()
- {
- // Add code you want to display here
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement