// testDiscriminant.cc  P. Conrad  Feb 09, 2007
// Section 20, 21, 22 
// test a function that calculates discriminant of a quadratic eqn

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


double discriminant(double a, double b, double c);

const double tolerance = 0.00001;


int main()
{

  // run a test case on our discriminant function

  double expectedValue = -108.0;
  double actualValue = discriminant(4.0, 6.0, 9.0);

  cout << "Test 1: ";

  if ( fabs(expectedValue-actualValue) < tolerance )
    cout << "Passed" << endl;
  else
    cout << "Failed" << endl;


  return 0;

}


