// testAreaOfRect.m   Run regression tests on areaOfRect.cc 
// P. Conrad CISC106 Fall 2006

#include <iostream>
#include <cmath>  // for fabs
using namespace std;

const double tolerance = 0.001;

// function prototypes

double areaOfRect(double length, double width);

// main program

int main()
{
  
  cout << "Test 1...";

  double actual1 = areaOfRect(3,4);
  double expected1 = 12;

  if (fabs(actual1 - expected1) < tolerance)
    cout << "passed" << endl;
  else  
    cout << "failed" << endl;

  cout << "Test 2...";

  double actual2 = areaOfRect(7,2);
  double expected2 = 14;

  if (fabs(actual2 - expected2) < tolerance)
    cout << "passed" << endl;
  else  
    cout << "failed" << endl;

  return 0;
}
