diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/test/lltut.h | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/test/lltut.h')
-rw-r--r-- | linden/indra/test/lltut.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/linden/indra/test/lltut.h b/linden/indra/test/lltut.h index 3e43df8..626ff60 100644 --- a/linden/indra/test/lltut.h +++ b/linden/indra/test/lltut.h | |||
@@ -41,11 +41,27 @@ | |||
41 | 41 | ||
42 | #include "lldate.h" | 42 | #include "lldate.h" |
43 | #include "lluri.h" | 43 | #include "lluri.h" |
44 | #include "llmath.h" | ||
44 | 45 | ||
45 | class LLSD; | 46 | class LLSD; |
46 | 47 | ||
47 | namespace tut | 48 | namespace tut |
48 | { | 49 | { |
50 | inline void ensure_approximately_equals(const char* msg, F32 actual, F32 expected, U32 frac_bits) | ||
51 | { | ||
52 | if(!is_approx_equal_fraction(actual, expected, frac_bits)) | ||
53 | { | ||
54 | std::stringstream ss; | ||
55 | ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected; | ||
56 | throw tut::failure(ss.str().c_str()); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | inline void ensure_approximately_equals(F32 actual, F32 expected, U32 frac_bits) | ||
61 | { | ||
62 | ensure_approximately_equals(NULL, actual, expected, frac_bits); | ||
63 | } | ||
64 | |||
49 | inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) | 65 | inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) |
50 | { | 66 | { |
51 | if((expected_len != actual_len) || | 67 | if((expected_len != actual_len) || |