aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests
diff options
context:
space:
mode:
authorOren Hurvitz2012-04-23 17:26:37 +0300
committerJustin Clark-Casey (justincc)2012-04-26 22:49:14 +0100
commit0da8fe3124402581883f87b2f7036727905038db (patch)
tree9f8d42b76595236307a82c7c3c25b286e644795a /OpenSim/Framework/Tests
parentWhen creating an OAR, objects where the user is the Creator are always includ... (diff)
downloadopensim-SC-0da8fe3124402581883f87b2f7036727905038db.zip
opensim-SC-0da8fe3124402581883f87b2f7036727905038db.tar.gz
opensim-SC-0da8fe3124402581883f87b2f7036727905038db.tar.bz2
opensim-SC-0da8fe3124402581883f87b2f7036727905038db.tar.xz
Refactored how asset/inventory types are associated with content types: gathered all the knowledge into a single class. Added the Mesh content type.
Diffstat (limited to 'OpenSim/Framework/Tests')
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index 1ca35df..f0d2a3f 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -214,16 +214,13 @@ namespace OpenSim.Framework.Tests
214 214
215 for (int i = 0; i < contenttypes.Length; i++) 215 for (int i = 0; i < contenttypes.Length; i++)
216 { 216 {
217 if (SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == 18) 217 int expected;
218 { 218 if (contenttypes[i] == "image/tga")
219 Assert.That(contenttypes[i] == "image/tga"); 219 expected = 12; // if we know only the content-type "image/tga", then we assume the asset type is TextureTGA; not ImageTGA
220 }
221 else 220 else
222 { 221 expected = assettypes[i];
223 Assert.That(SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == assettypes[i], 222 Assert.AreEqual(expected, SLUtil.ContentTypeToSLAssetType(contenttypes[i]),
224 "Expecting {0} but got {1}", assettypes[i], 223 String.Format("Incorrect AssetType mapped from Content-Type {0}", contenttypes[i]));
225 SLUtil.ContentTypeToSLAssetType(contenttypes[i]));
226 }
227 } 224 }
228 225
229 int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20}; 226 int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20};
@@ -237,7 +234,7 @@ namespace OpenSim.Framework.Tests
237 "application/vnd.ll.primitive", 234 "application/vnd.ll.primitive",
238 "application/vnd.ll.notecard", 235 "application/vnd.ll.notecard",
239 "application/vnd.ll.folder", 236 "application/vnd.ll.folder",
240 "application/octet-stream", 237 "application/vnd.ll.rootfolder",
241 "application/vnd.ll.lsltext", 238 "application/vnd.ll.lsltext",
242 "image/x-j2c", 239 "image/x-j2c",
243 "application/vnd.ll.primitive", 240 "application/vnd.ll.primitive",
@@ -247,7 +244,8 @@ namespace OpenSim.Framework.Tests
247 244
248 for (int i=0;i<inventorytypes.Length;i++) 245 for (int i=0;i<inventorytypes.Length;i++)
249 { 246 {
250 Assert.That(SLUtil.SLInvTypeToContentType(inventorytypes[i]) == invcontenttypes[i], "Expected {0}, Got {1}", invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i])); 247 Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]),
248 String.Format("Incorrect Content-Type mapped from InventoryType {0}", inventorytypes[i]));
251 } 249 }
252 250
253 invcontenttypes = new string[] 251 invcontenttypes = new string[]
@@ -280,7 +278,8 @@ namespace OpenSim.Framework.Tests
280 278
281 for (int i = 0; i < invtypes.Length; i++) 279 for (int i = 0; i < invtypes.Length; i++)
282 { 280 {
283 Assert.That(SLUtil.ContentTypeToSLInvType(invcontenttypes[i]) == invtypes[i], "Expected {0}, Got {1}", invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i])); 281 Assert.AreEqual(invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i]),
282 String.Format("Incorrect InventoryType mapped from Content-Type {0}", invcontenttypes[i]));
284 } 283 }
285 } 284 }
286 } 285 }