summaryrefslogtreecommitdiff
path: root/indra/test/lltut.h
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-05-03 21:48:14 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-05-03 21:48:14 +0000
commit08d746156b56d8b72919af8cbca25609c855ef82 (patch)
tree51d4c6d06b87b5477e3c61d42ee49de19a2d72b6 /indra/test/lltut.h
parent5de49ccb321aba6f09111e74abbb965b630f8d27 (diff)
Result of svn merge -r59717:60410 svn+ssh://svn/svn/linden/branches/adroit.2007-03-13 into release.
Diffstat (limited to 'indra/test/lltut.h')
-rw-r--r--indra/test/lltut.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/test/lltut.h b/indra/test/lltut.h
index 99dd71b78c..6f1fee2b2f 100644
--- a/indra/test/lltut.h
+++ b/indra/test/lltut.h
@@ -21,11 +21,27 @@
#include "lldate.h"
#include "lluri.h"
+#include "llmath.h"
class LLSD;
namespace tut
{
+ inline void ensure_approximately_equals(const char* msg, F32 actual, F32 expected, U32 frac_bits)
+ {
+ if(!is_approx_equal_fraction(actual, expected, frac_bits))
+ {
+ std::stringstream ss;
+ ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected;
+ throw tut::failure(ss.str().c_str());
+ }
+ }
+
+ inline void ensure_approximately_equals(F32 actual, F32 expected, U32 frac_bits)
+ {
+ ensure_approximately_equals(NULL, actual, expected, frac_bits);
+ }
+
inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len)
{
if((expected_len != actual_len) ||