#include <iostream>
#include "genetic_operators_test.h"
#include "individual_test.h"
#include "population_block_test.h"
#include "fresh_list_block_test.h"
#include "population_test.h"

#define TEST_OK " ... test went OK"
#define TEST_ERROR " ... encountered error "

using namespace std;

int main() {
  int err_no;

  char *test_tbl = "individual_test.pat";
  int test_cells = 5;

  cout << "Code Testing Utility" << endl;
  cout << "--------------------" << endl << endl;
  cout << "Testing classes:" << endl;

  cout << "  \"individual\"";
  individual_test ind_test;

  if((err_no = ind_test.test(test_tbl, test_cells)) == TI_OK)
    cout << TEST_OK << endl;
  else cout << TEST_ERROR << err_no << endl;

  cout << "  \"genetic_operators\"" << endl;
  genetic_operators_test go_test;

  if((err_no = go_test.test(test_cells)) == TGO_OK)
    cout << TEST_OK << endl;
  else cout << TEST_ERROR << err_no << endl;

  cout << "  \"population_block\"";
  population_block_test pop_blk_test;

  if((err_no = pop_blk_test.test(test_cells)) == TPB_OK)
    cout << TEST_OK << endl;
  else cout << TEST_ERROR << err_no << endl;

  cout << "  \"fresh_list_block\"";
  fresh_list_block_test fresh_blk_test;

  if((err_no = fresh_blk_test.test()) == TFB_OK)
    cout << TEST_OK << endl;
  else cout << TEST_ERROR << err_no << endl;

  cout << "  \"population\"";
  population_test pop_test;

  if((err_no = pop_test.test(test_cells)) == TP_OK)
    cout << TEST_OK << endl;
  else cout << TEST_ERROR << err_no << endl;

  cout << endl;
  return 0;
}

