diff options
Diffstat (limited to 'linden/indra/test/lltut.h')
-rw-r--r-- | linden/indra/test/lltut.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/linden/indra/test/lltut.h b/linden/indra/test/lltut.h index c8fb6bc..3e43df8 100644 --- a/linden/indra/test/lltut.h +++ b/linden/indra/test/lltut.h | |||
@@ -6,6 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Copyright (c) 2005-2007, Linden Research, Inc. | 7 | * Copyright (c) 2005-2007, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
10 | * to you under the terms of the GNU General Public License, version 2.0 | 11 | * to you under the terms of the GNU General Public License, version 2.0 |
11 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -45,6 +46,22 @@ class LLSD; | |||
45 | 46 | ||
46 | namespace tut | 47 | namespace tut |
47 | { | 48 | { |
49 | inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) | ||
50 | { | ||
51 | if((expected_len != actual_len) || | ||
52 | (memcmp(actual, expected, actual_len) != 0)) | ||
53 | { | ||
54 | std::stringstream ss; | ||
55 | ss << (msg?msg:"") << (msg?": ":"") << "not equal"; | ||
56 | throw tut::failure(ss.str().c_str()); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | inline void ensure_memory_matches(const void* actual, U32 actual_len, const void* expected,U32 expected_len) | ||
61 | { | ||
62 | ensure_memory_matches(NULL, actual, actual_len, expected, expected_len); | ||
63 | } | ||
64 | |||
48 | template <class T,class Q> | 65 | template <class T,class Q> |
49 | void ensure_not_equals(const char* msg,const Q& actual,const T& expected) | 66 | void ensure_not_equals(const char* msg,const Q& actual,const T& expected) |
50 | { | 67 | { |