// testMyMin.cc   Run regression tests on testMyMin.cc 
// P. Conrad CISC106 Fall 2006

#include <iostream>
using namespace std;

// function prototypes

int myMin(int v[], int length);

// main program

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

  int a[] = {3, 4, 1, 7, -2, 9};
  double actual1 = myMin(a,6);
  double expected1 = -2;

  // ok to do exact comparison with integers
  // (don't need to check fabs of difference against tolerance)

  if (actual1 == expected1)
    cout << "passed" << endl;
  else  
    cout << "failed" << endl;

  cout << "Test 2...";

  int b[] = {3, 2, 6, 2, 9};
  double actual2 = myMin(b,5);
  double expected2 = 2;

  if (actual2 == expected2)
    cout << "passed" << endl;
  else  
    cout << "failed" << endl;


  return 0;
}
