#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include "smallest.h"
using namespace std;

/*--------
  signature: main: void -> int

  purpose: testing program for the function smallest

  examples: when run, this should output to the screen:
testing smallest: true's should mean passed:
---------------------------------------
...followed by each testing call, hopefully
   followed by true to show it passed

  by: funct_play
  last modified: Thu Dec  1 14:03:40 PST 2016
--------*/

int main()
{
    cout << boolalpha;
    cout << endl;
    cout << "testing smallest: true's should mean passed: " << endl;
    cout << "---------------------------------------" << endl;

    const int NUM_VALS = 5;
    double vals[NUM_VALS] = {50, 2, 45.4, 22, 7};

    cout << "(smallest(vals, NUM_VALS) == 2): " 
         << (smallest(vals, NUM_VALS) == 2) << endl;

    cout << "(smallest(vals, 0) == 0.0): " 
         << (smallest(vals, 0) == 0.0) << endl;

    const int NUM_WIDGETS = 3;
    double widg_hts[NUM_WIDGETS] = {-10, -11, 0};

    cout << "(smallest(widg_hts, NUM_WIDGETS) == -11): " 
         << (smallest(widg_hts, NUM_WIDGETS) == -11) << endl;
    cout << endl;

    return EXIT_SUCCESS;
}