aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests/UtilTest.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs114
1 files changed, 114 insertions, 0 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index 45d822c..89f5c0c 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -170,5 +170,119 @@ namespace OpenSim.Framework.Tests
170 // Varying secrets should not eqal the same 170 // Varying secrets should not eqal the same
171 Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret2")); 171 Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret2"));
172 } 172 }
173
174 [Test]
175 public void SLUtilTypeConvertTests()
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
178 ,23,24,25,46,47,48};
179 string[] contenttypes = new string[]
180 {
181 "application/octet-stream",
182 "image/x-j2c",
183 "audio/ogg",
184 "application/vnd.ll.callingcard",
185 "application/vnd.ll.landmark",
186 "application/vnd.ll.clothing",
187 "application/vnd.ll.primitive",
188 "application/vnd.ll.notecard",
189 "application/vnd.ll.folder",
190 "application/vnd.ll.rootfolder",
191 "application/vnd.ll.lsltext",
192 "application/vnd.ll.lslbyte",
193 "image/tga",
194 "application/vnd.ll.bodypart",
195 "application/vnd.ll.trashfolder",
196 "application/vnd.ll.snapshotfolder",
197 "application/vnd.ll.lostandfoundfolder",
198 "audio/x-wav",
199 "image/tga",
200 "image/jpeg",
201 "application/vnd.ll.animation",
202 "application/vnd.ll.gesture",
203 "application/x-metaverse-simstate",
204 "application/vnd.ll.favoritefolder",
205 "application/vnd.ll.link",
206 "application/vnd.ll.linkfolder",
207 "application/vnd.ll.currentoutfitfolder",
208 "application/vnd.ll.outfitfolder",
209 "application/vnd.ll.myoutfitsfolder"
210 };
211 for (int i=0;i<assettypes.Length;i++)
212 {
213 Assert.That(SLUtil.SLAssetTypeToContentType(assettypes[i]) == contenttypes[i], "Expecting {0} but got {1}", contenttypes[i], SLUtil.SLAssetTypeToContentType(assettypes[i]));
214 }
215
216 for (int i = 0; i < contenttypes.Length; i++)
217 {
218 if (SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == 18)
219 {
220 Assert.That(contenttypes[i] == "image/tga");
221 }
222 else
223 {
224 Assert.That(SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == assettypes[i],
225 "Expecting {0} but got {1}", assettypes[i],
226 SLUtil.ContentTypeToSLAssetType(contenttypes[i]));
227 }
228 }
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 }
286 }
173 } 287 }
174} 288}