//----------------------------  tests.h  ---------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 2004 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//----------------------------  tests.h  ---------------------------


// common definitions used in all the tests


#include <base/logstream.h>
#include <cmath>

// overload floating point output operators for LogStream so that small
// numbers below a certain threshold are simply printed as zeros. this removes
// a number of possible places where output may differ depending on platform,
// compiler options, etc, simply because round-off is different.
LogStream & operator << (LogStream &logstream,
                         const double d)
{
  if (std::fabs (d) < 1e-10)
    logstream << 0.;
  else
    logstream << d;
  return logstream;
}


LogStream & operator << (LogStream &logstream,
                         const float d)
{
  if (std::fabs (d) < 1e-8)
    logstream << 0.;
  else
    logstream << d;
  return logstream;
}

Add a file with common definitions to be used by all testcases.
Add a file with common definitions to be used by all testcases.


git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@8395 0785d39b-7218-0410-832d-ea1e28bc413d
