Started adding tests for Approx

This commit is contained in:
Phil Nash 2011-04-28 08:28:03 +01:00
parent dfea75fc05
commit 0ea29b7d28
2 changed files with 54 additions and 1 deletions

View file

@ -47,6 +47,17 @@ namespace Catch
return fabs( lhs - rhs.m_d ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_d) ) );
}
///////////////////////////////////////////////////////////////////////////
template<typename T>
friend bool operator ==
(
const Approx& lhs,
const T& rhs
)
{
return operator==( rhs, lhs );
}
///////////////////////////////////////////////////////////////////////////
template<typename T>
friend bool operator !=
@ -58,7 +69,18 @@ namespace Catch
return !operator==( lhs, rhs );
}
///////////////////////////////////////////////////////////////////////////
template<typename T>
friend bool operator !=
(
const Approx& lhs,
const T& rhs
)
{
return !operator==( rhs, lhs );
}
///////////////////////////////////////////////////////////////////////////
Approx& epsilon
(