SHARE
TWEET

Untitled

a guest Feb 26th, 2020 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  *  @author Stephen Gilbert
  3.  *  @date CS 150 Testing Template
  4.  */
  5. #include <iostream>
  6. #include <iomanip>
  7. #include <string>
  8. #include <cmath>
  9. #include <algorithm>
  10. #include <vector>
  11. #include <fstream>
  12. using namespace std;
  13.  
  14. #include "cs150check.h"
  15.  
  16. ///////////// Add header for function being tested
  17. #include "extreme.h"
  18.  
  19. //////////// Add your student ID here
  20. string STUDENT = "dnguyen1515";
  21. const double EPSILON = 1.0e-14;
  22.  
  23. void runTests()
  24. {
  25.     srand(time(0));
  26.  
  27.     ///////////// Begin a set of tests
  28.     beginTests(); // test heading
  29.  
  30.     /////// Tests for function //////////////////////
  31.     beginFunctionTest("max"); // Test title
  32.  
  33.     assertDoubleEquals(5.2, ex::max(5.2, 3.6), EPSILON); // double
  34.     assertDoubleEquals(5.2, ex::max(3.6, 5.2), EPSILON); // double
  35.     assertDoubleEquals(5.2, ex::max(-17.0, 5.2), EPSILON); // double
  36.  
  37.     endFunctionTest(); // end
  38.  
  39.     beginFunctionTest("min"); // Test title
  40.  
  41.     assertDoubleEquals(3.6, ex::min(5.2, 3.6), EPSILON); // double
  42.     assertDoubleEquals(3.6, ex::min(3.6, 5.2), EPSILON); // double
  43.     assertDoubleEquals(-17.0, ex::min(-17.0, 5.2), EPSILON); // double
  44.  
  45.     endFunctionTest(); // end
  46.  
  47.  
  48.     ///////// End all test runs /////////////////////////
  49.     endTests();
  50. }
  51.  
  52. //////////// Student tests or run
  53. int run()
  54. {
  55.     // Add code you want to display here
  56.     return 0;
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top