aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/test/llinventoryparcel_tut.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:56 -0500
committerJacek Antonelli2008-08-15 23:44:56 -0500
commitc07901e29ed545bbb02e3bddf148fe1104b94e9f (patch)
treef1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/test/llinventoryparcel_tut.cpp
parentSecond Life viewer sources 1.15.0.2 (diff)
downloadmeta-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 '')
-rw-r--r--linden/indra/test/llinventoryparcel_tut.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/linden/indra/test/llinventoryparcel_tut.cpp b/linden/indra/test/llinventoryparcel_tut.cpp
new file mode 100644
index 0000000..1a815ca
--- /dev/null
+++ b/linden/indra/test/llinventoryparcel_tut.cpp
@@ -0,0 +1,70 @@
1/**
2 * @file llinventoryparcel_tut.cpp
3 * @author Moss
4 * @date 2007-04-17
5 *
6 * Copyright (c) 2007-2007, Linden Research, Inc.
7 *
8 * Second Life Viewer Source Code
9 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include "linden_common.h"
31#include "lltut.h"
32
33#include "llparcel.h"
34
35#include <string>
36
37namespace tut
38{
39 struct llinventoryparcel_data
40 {
41 };
42 typedef test_group<llinventoryparcel_data> llinventoryparcel_test;
43 typedef llinventoryparcel_test::object llinventoryparcel_object;
44 tut::llinventoryparcel_test llinventoryparcel("llinventoryparcel");
45
46 template<> template<>
47 void llinventoryparcel_object::test<1>()
48 {
49 for (S32 i=0; i<LLParcel::C_COUNT; ++i)
50 {
51 const char *catstring = LLParcel::getCategoryString(LLParcel::ECategory(i));
52 ensure("LLParcel::getCategoryString(i)",
53 NULL != catstring);
54
55 const char *catuistring = LLParcel::getCategoryUIString(LLParcel::ECategory(i));
56 ensure("LLParcel::getCategoryUIString(i)",
57 NULL != catuistring);
58
59 ensure_equals("LLParcel::ECategory mapping of string back to enum", LLParcel::getCategoryFromString(catstring), i);
60 ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), i);
61 }
62
63 // test the C_ANY case, which has to work for UI strings
64 const char *catuistring = LLParcel::getCategoryUIString(LLParcel::C_ANY);
65 ensure("LLParcel::getCategoryUIString(C_ANY)",
66 NULL != catuistring);
67
68 ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), LLParcel::C_ANY);
69 }
70}