aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-11 22:28:50 +0000
committerJustin Clark-Casey (justincc)2013-02-11 22:28:50 +0000
commitcbb8d82c7d37019f32c6d8166de53c75c29e27a5 (patch)
tree897b0272a89860f85acd930f2902194f4f43fc5e /OpenSim/Region/OptionalModules/Scripting
parentAdd test to try reading notecard into an invalid path in TestJsonReadNotecard... (diff)
downloadopensim-SC_OLD-cbb8d82c7d37019f32c6d8166de53c75c29e27a5.zip
opensim-SC_OLD-cbb8d82c7d37019f32c6d8166de53c75c29e27a5.tar.gz
opensim-SC_OLD-cbb8d82c7d37019f32c6d8166de53c75c29e27a5.tar.bz2
opensim-SC_OLD-cbb8d82c7d37019f32c6d8166de53c75c29e27a5.tar.xz
Add section to TestJsonSetValue() to test attempted set of value where the penultimate section of path does not exist
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs31
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index e91c02d..2af3afc 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -244,18 +244,33 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
244 TestHelpers.InMethod(); 244 TestHelpers.InMethod();
245// TestHelpers.EnableLogging(); 245// TestHelpers.EnableLogging();
246 246
247 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }"); 247 {
248 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
248 249
249 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun", "Times"); 250 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun", "Times");
250 Assert.That(result, Is.EqualTo(1)); 251 Assert.That(result, Is.EqualTo(1));
251 252
252 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun"); 253 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun");
253 Assert.That(value, Is.EqualTo("Times")); 254 Assert.That(value, Is.EqualTo("Times"));
255 }
256
257 // Test setting to location that does not exist. This should fail.
258 {
259 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }");
260
261 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun.Circus", "Times");
262 Assert.That(result, Is.EqualTo(0));
263
264 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun.Circus");
265 Assert.That(value, Is.EqualTo(""));
266 }
254 267
255 // Test with fake store 268 // Test with fake store
256 UUID fakeStoreId = TestHelpers.ParseTail(0x500); 269 {
257 int fakeStoreValueSet = (int)InvokeOp("JsonSetValue", fakeStoreId, "Hello", "World"); 270 UUID fakeStoreId = TestHelpers.ParseTail(0x500);
258 Assert.That(fakeStoreValueSet, Is.EqualTo(0)); 271 int fakeStoreValueSet = (int)InvokeOp("JsonSetValue", fakeStoreId, "Hello", "World");
272 Assert.That(fakeStoreValueSet, Is.EqualTo(0));
273 }
259 } 274 }
260 275
261 /// <summary> 276 /// <summary>