diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/test/lltut.h | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-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 | { |