aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2010-09-18 02:49:42 -0400
committerTeravus Ovares (Dan Olivares)2010-09-18 02:49:42 -0400
commitc203fae26bc30198989df7d8c85084dc69c25be8 (patch)
tree50965fb53f7427a2466683a554e39b680104ba1c /OpenSim
parent* More Mundane Tests (diff)
downloadopensim-SC_OLD-c203fae26bc30198989df7d8c85084dc69c25be8.zip
opensim-SC_OLD-c203fae26bc30198989df7d8c85084dc69c25be8.tar.gz
opensim-SC_OLD-c203fae26bc30198989df7d8c85084dc69c25be8.tar.bz2
opensim-SC_OLD-c203fae26bc30198989df7d8c85084dc69c25be8.tar.xz
* Covered the type converters in SLUtil with unit tests.
* Does anyone have an example raw notecard to look at and test the notecard parser?
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs58
1 files changed, 57 insertions, 1 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index d04cbc6..89f5c0c 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Framework.Tests
172 } 172 }
173 173
174 [Test] 174 [Test]
175 public void SLUtilTests() 175 public void SLUtilTypeConvertTests()
176 { 176 {
177 int[] assettypes = new int[]{-1,0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 177 int[] assettypes = new int[]{-1,0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
178 ,23,24,25,46,47,48}; 178 ,23,24,25,46,47,48};
@@ -227,6 +227,62 @@ namespace OpenSim.Framework.Tests
227 } 227 }
228 } 228 }
229 229
230 int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20};
231 string[] invcontenttypes = new string[]
232 {
233 "application/octet-stream",
234 "image/x-j2c",
235 "audio/ogg",
236 "application/vnd.ll.callingcard",
237 "application/vnd.ll.landmark",
238 "application/vnd.ll.primitive",
239 "application/vnd.ll.notecard",
240 "application/vnd.ll.folder",
241 "application/octet-stream",
242 "application/vnd.ll.lsltext",
243 "image/x-j2c",
244 "application/vnd.ll.primitive",
245 "application/vnd.ll.clothing",
246 "application/vnd.ll.gesture"
247 };
248
249 for (int i=0;i<inventorytypes.Length;i++)
250 {
251 Assert.That(SLUtil.SLInvTypeToContentType(inventorytypes[i]) == invcontenttypes[i], "Expected {0}, Got {1}", invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]));
252 }
253
254 invcontenttypes = new string[]
255 {
256 "image/x-j2c","image/jp2","image/tga",
257 "image/jpeg","application/ogg","audio/ogg",
258 "audio/x-wav","application/vnd.ll.callingcard",
259 "application/x-metaverse-callingcard",
260 "application/vnd.ll.landmark",
261 "application/x-metaverse-landmark",
262 "application/vnd.ll.clothing",
263 "application/x-metaverse-clothing","application/vnd.ll.bodypart",
264 "application/x-metaverse-bodypart","application/vnd.ll.primitive",
265 "application/x-metaverse-primitive","application/vnd.ll.notecard",
266 "application/x-metaverse-notecard","application/vnd.ll.folder",
267 "application/vnd.ll.rootfolder","application/vnd.ll.lsltext",
268 "application/x-metaverse-lsl","application/vnd.ll.lslbyte",
269 "application/x-metaverse-lso","application/vnd.ll.trashfolder",
270 "application/vnd.ll.snapshotfolder",
271 "application/vnd.ll.lostandfoundfolder","application/vnd.ll.animation",
272 "application/x-metaverse-animation","application/vnd.ll.gesture",
273 "application/x-metaverse-gesture","application/x-metaverse-simstate",
274 "application/octet-stream"
275 };
276 sbyte[] invtypes = new sbyte[]
277 {
278 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 18, 18, 18, 18, 6, 6, 7, 7, 8, 9, 10, 10, 10, 10
279 , 8, 8, 8, 19, 19, 20, 20, 15, -1
280 };
281
282 for (int i = 0; i < invtypes.Length; i++)
283 {
284 Assert.That(SLUtil.ContentTypeToSLInvType(invcontenttypes[i]) == invtypes[i], "Expected {0}, Got {1}", invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i]));
285 }
230 } 286 }
231 } 287 }
232} 288}