diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/test/inventory.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/test/inventory.cpp')
-rw-r--r-- | linden/indra/test/inventory.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/linden/indra/test/inventory.cpp b/linden/indra/test/inventory.cpp index a4a4599..97a36d8 100644 --- a/linden/indra/test/inventory.cpp +++ b/linden/indra/test/inventory.cpp | |||
@@ -36,6 +36,11 @@ | |||
36 | #include "llinventory.h" | 36 | #include "llinventory.h" |
37 | #include "llsd.h" | 37 | #include "llsd.h" |
38 | 38 | ||
39 | #if LL_WINDOWS | ||
40 | // disable unreachable code warnings | ||
41 | #pragma warning(disable: 4702) | ||
42 | #endif | ||
43 | |||
39 | LLPointer<LLInventoryItem> create_random_inventory_item() | 44 | LLPointer<LLInventoryItem> create_random_inventory_item() |
40 | { | 45 | { |
41 | LLUUID item_id; | 46 | LLUUID item_id; |
@@ -67,8 +72,8 @@ LLPointer<LLInventoryItem> create_random_inventory_item() | |||
67 | asset_id, | 72 | asset_id, |
68 | LLAssetType::AT_OBJECT, | 73 | LLAssetType::AT_OBJECT, |
69 | LLInventoryType::IT_ATTACHMENT, | 74 | LLInventoryType::IT_ATTACHMENT, |
70 | "Sample Object", | 75 | std::string("Sample Object"), |
71 | "Used for Testing", | 76 | std::string("Used for Testing"), |
72 | sale_info, | 77 | sale_info, |
73 | flags, | 78 | flags, |
74 | creation); | 79 | creation); |
@@ -86,7 +91,7 @@ LLPointer<LLInventoryCategory> create_random_inventory_cat() | |||
86 | item_id, | 91 | item_id, |
87 | parent_id, | 92 | parent_id, |
88 | LLAssetType::AT_NONE, | 93 | LLAssetType::AT_NONE, |
89 | "Sample category"); | 94 | std::string("Sample category")); |
90 | return cat; | 95 | return cat; |
91 | } | 96 | } |
92 | 97 | ||
@@ -105,10 +110,10 @@ namespace tut | |||
105 | template<> template<> | 110 | template<> template<> |
106 | void inventory_object::test<1>() | 111 | void inventory_object::test<1>() |
107 | { | 112 | { |
108 | LLInventoryType::EType retType = LLInventoryType::lookup("sound"); | 113 | LLInventoryType::EType retType = LLInventoryType::lookup(std::string("sound")); |
109 | ensure("1.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SOUND); | 114 | ensure("1.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SOUND); |
110 | 115 | ||
111 | retType = LLInventoryType::lookup("snapshot"); | 116 | retType = LLInventoryType::lookup(std::string("snapshot")); |
112 | ensure("2.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SNAPSHOT); | 117 | ensure("2.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SNAPSHOT); |
113 | } | 118 | } |
114 | 119 | ||
@@ -173,7 +178,7 @@ namespace tut | |||
173 | new_parent_id.generate(); | 178 | new_parent_id.generate(); |
174 | src->setParent(new_parent_id); | 179 | src->setParent(new_parent_id); |
175 | 180 | ||
176 | LLString new_name = "LindenLab"; | 181 | std::string new_name = "LindenLab"; |
177 | src->rename(new_name); | 182 | src->rename(new_name); |
178 | 183 | ||
179 | src->setType(LLAssetType::AT_SOUND); | 184 | src->setType(LLAssetType::AT_SOUND); |
@@ -182,7 +187,7 @@ namespace tut | |||
182 | new_asset_id.generate(); | 187 | new_asset_id.generate(); |
183 | 188 | ||
184 | src->setAssetUUID(new_asset_id); | 189 | src->setAssetUUID(new_asset_id); |
185 | LLString new_desc = "SecondLife Testing"; | 190 | std::string new_desc = "SecondLife Testing"; |
186 | src->setDescription(new_desc); | 191 | src->setDescription(new_desc); |
187 | 192 | ||
188 | S32 new_price = rand(); | 193 | S32 new_price = rand(); |
@@ -244,7 +249,7 @@ namespace tut | |||
244 | new_parent_id.generate(); | 249 | new_parent_id.generate(); |
245 | src->setParent(new_parent_id); | 250 | src->setParent(new_parent_id); |
246 | 251 | ||
247 | LLString new_name = "LindenLab"; | 252 | std::string new_name = "LindenLab"; |
248 | src->rename(new_name); | 253 | src->rename(new_name); |
249 | 254 | ||
250 | src->setType(LLAssetType::AT_SOUND); | 255 | src->setType(LLAssetType::AT_SOUND); |
@@ -253,7 +258,7 @@ namespace tut | |||
253 | new_asset_id.generate(); | 258 | new_asset_id.generate(); |
254 | 259 | ||
255 | src->setAssetUUID(new_asset_id); | 260 | src->setAssetUUID(new_asset_id); |
256 | LLString new_desc = "SecondLife Testing"; | 261 | std::string new_desc = "SecondLife Testing"; |
257 | src->setDescription(new_desc); | 262 | src->setDescription(new_desc); |
258 | 263 | ||
259 | S32 new_price = rand(); | 264 | S32 new_price = rand(); |
@@ -453,7 +458,6 @@ namespace tut | |||
453 | ensure_equals("9.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice()); | 458 | ensure_equals("9.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice()); |
454 | ensure_equals("10.name::getName() failed", src1->getName(), src2->getName()); | 459 | ensure_equals("10.name::getName() failed", src1->getName(), src2->getName()); |
455 | ensure_equals("11.description::getDescription() failed", src1->getDescription(), src2->getDescription()); | 460 | ensure_equals("11.description::getDescription() failed", src1->getDescription(), src2->getDescription()); |
456 | //skip_fail("12.creation::getCreationDate()"); | ||
457 | ensure_equals("12.creation::getCreationDate() failed", src1->getCreationDate(), src2->getCreationDate()); | 461 | ensure_equals("12.creation::getCreationDate() failed", src1->getCreationDate(), src2->getCreationDate()); |
458 | } | 462 | } |
459 | 463 | ||