From 71f2176c4bc995b3cd6cffbf1a43d21f9c853049 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 10 Sep 2008 20:33:02 +0000 Subject: add a simple update attribute test for SOG & SQLite --- OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs index 727174d..2e93fd6 100644 --- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs +++ b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs @@ -103,11 +103,31 @@ namespace OpenSim.Data.SQLite.Tests } [Test] - public void T010_UpdateObject() + public void T012_UpdateObject() { - + string text = "object1 text"; + SceneObjectGroup sog = FindSOG("object1", region); + sog.RootPart.Text = text; + db.StoreObject(sog, region); + + sog = FindSOG("object1", region); + Assert.That(text, Text.Matches(sog.RootPart.Text)); } + // Extra private methods + + private SceneObjectGroup FindSOG(string name, UUID r) + { + List objs = db.LoadObjects(r); + foreach (SceneObjectGroup sog in objs) + { + SceneObjectPart p = sog.RootPart; + if (p.Name == name) { + return sog; + } + } + return null; + } private SceneObjectGroup NewSOG(string name) { -- cgit v1.1