//////////////////////////////////////////////////////////////////////////////
// $Id: TestsUtils_tmpl.h,v 1.1.1.1 2003/09/15 16:37:49 nthiery Exp $
// Name:	TestsUtils.h
// Purpose:	GLIP test suite, C++ utilities
//		(Templates implementation)
// Author:	Nicolas M. Thiéry <nthiery@mines.edu>
// Created:	2000/08
// Copyright:	LGPL
//////////////////////////////////////////////////////////////////////////////

#ifndef GLIP_TESTSUTILS_TMPL_H
#define GLIP_TESTSUTILS_TMPL_H


template <class T1, class T2>
void test (T1 const &result, T2 const &expected, string name) {
  if (result == expected) {
    pass();
    cout << "PASS: " << name << endl;
  } else {
    fail();
    if (verbose) {
      cout << "FAIL: " << name
	   << "\t( Got `" << result << "' Instead of `" << expected << "')\n";
    } else {
      cout << "FAIL: " << name << endl;
    }
  }
}

template <class T1, class T2>
void xtest (T1 const &result, T2 const &expected, string name) {
  if (result == expected) {
    xpass();
    cout << "XPASS: " << name << endl;
  } else {
    xfail();
    if (verbose) {
      cout << "XFAIL: " << name
	   << "\t( Got `" << result << "' Instead of `" << expected << "')\n";
    } else {
      cout << "XFAIL: " << name << endl;
    }
  }
}

#endif	/* GLIP_TESTUTILS_TMPL_H */

// Local Variables: 
// mode: c++
// End: 
