diff options
author | Justin Clark-Casey (justincc) | 2009-11-09 15:49:09 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-11-09 15:49:09 +0000 |
commit | 668850b974fba428a527c01249e8e76619461d23 (patch) | |
tree | 7edbae7e80fe1197a908914ffb24b46178bccc56 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |
parent | add unit test for iar & escaping (diff) | |
download | opensim-SC_OLD-668850b974fba428a527c01249e8e76619461d23.zip opensim-SC_OLD-668850b974fba428a527c01249e8e76619461d23.tar.gz opensim-SC_OLD-668850b974fba428a527c01249e8e76619461d23.tar.bz2 opensim-SC_OLD-668850b974fba428a527c01249e8e76619461d23.tar.xz |
* for iars, allow item names/folders including "/" to be escaped using "\/"
* also, "\" has to be escaped as "\\"
* add item name unit test for escaped characters
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index c366150..bcae5f5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -296,7 +296,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
296 | TestHelper.InMethod(); | 296 | TestHelper.InMethod(); |
297 | log4net.Config.XmlConfigurator.Configure(); | 297 | log4net.Config.XmlConfigurator.Configure(); |
298 | 298 | ||
299 | string itemName = "You & you are a mean man"; | 299 | string itemName = "You & you are a mean/man/"; |
300 | string humanEscapedItemName = @"You & you are a mean\/man\/"; | ||
300 | string userPassword = "meowfood"; | 301 | string userPassword = "meowfood"; |
301 | 302 | ||
302 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 303 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
@@ -362,7 +363,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
362 | Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); | 363 | Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); |
363 | mre.WaitOne(60000, false); | 364 | mre.WaitOne(60000, false); |
364 | 365 | ||
365 | /// LOAD ITEM | 366 | // LOAD ITEM |
366 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 367 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
367 | 368 | ||
368 | archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream); | 369 | archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream); |
@@ -371,7 +372,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
371 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 372 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
372 | 373 | ||
373 | InventoryItemBase foundItem1 | 374 | InventoryItemBase foundItem1 |
374 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userId, "Scripts/Objects/" + itemName); | 375 | = InventoryArchiveUtils.FindItemByPath( |
376 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); | ||
375 | 377 | ||
376 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 378 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
377 | // Assert.That( | 379 | // Assert.That( |