diff options
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) { |