diff options
author | Karen Clark <karen@lindenlab.com> | 2007-03-20 22:21:42 +0000 |
---|---|---|
committer | Karen Clark <karen@lindenlab.com> | 2007-03-20 22:21:42 +0000 |
commit | fceae96eb171be0396512e251aab311d4e3ef9cc (patch) | |
tree | e648d1dd42aeae4d47168bd8d696ff0895819b8b /indra/test/lltut.h | |
parent | 5e9e67cb2d1d3dfc82dfe96103270b2341991ddd (diff) |
svn merge -r59459:59476 svn+ssh://svn.lindenlab.com/svn/linden/branches/adroit.r69-75_2 into svn+ssh://svn.lindenlab.com/svn/linden/release.
Diffstat (limited to 'indra/test/lltut.h')
-rw-r--r-- | indra/test/lltut.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/test/lltut.h b/indra/test/lltut.h index c2ec504857..99dd71b78c 100644 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -26,6 +26,22 @@ class LLSD; namespace tut { + 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) || + (memcmp(actual, expected, actual_len) != 0)) + { + std::stringstream ss; + ss << (msg?msg:"") << (msg?": ":"") << "not equal"; + throw tut::failure(ss.str().c_str()); + } + } + + inline void ensure_memory_matches(const void* actual, U32 actual_len, const void* expected,U32 expected_len) + { + ensure_memory_matches(NULL, actual, actual_len, expected, expected_len); + } + template <class T,class Q> void ensure_not_equals(const char* msg,const Q& actual,const T& expected) { |