diff options
author | Sean Dague | 2008-09-10 19:14:12 +0000 |
---|---|---|
committer | Sean Dague | 2008-09-10 19:14:12 +0000 |
commit | cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c (patch) | |
tree | 5ddaadb9fcee271229e517c971b09caceb02b272 /OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs | |
parent | break the rsync line because bamboo doesn't accept it in the comment field (diff) | |
download | opensim-SC_OLD-cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c.zip opensim-SC_OLD-cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c.tar.gz opensim-SC_OLD-cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c.tar.bz2 opensim-SC_OLD-cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c.tar.xz |
added in a few more tests
Diffstat (limited to 'OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs')
-rw-r--r-- | OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs index fa5193f..727174d 100644 --- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs +++ b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using NUnit.Framework.SyntaxHelpers; | ||
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Data.SQLite; | 33 | using OpenSim.Data.SQLite; |
33 | using OpenSim.Region.Environment.Scenes; | 34 | using OpenSim.Region.Environment.Scenes; |
@@ -64,24 +65,57 @@ namespace OpenSim.Data.SQLite.Tests | |||
64 | Assert.AreEqual(0, objs.Count); | 65 | Assert.AreEqual(0, objs.Count); |
65 | } | 66 | } |
66 | 67 | ||
68 | // SOG round trips | ||
69 | // * store objects, make sure they save | ||
70 | // * update | ||
71 | |||
67 | [Test] | 72 | [Test] |
68 | public void T010_StoreObject() | 73 | public void T010_StoreSimpleObject() |
69 | { | 74 | { |
70 | SceneObjectGroup sog = NewSOG(); | 75 | SceneObjectGroup sog = NewSOG("object1"); |
76 | SceneObjectGroup sog2 = NewSOG("object2"); | ||
71 | 77 | ||
72 | db.StoreObject(sog, region); | 78 | db.StoreObject(sog, region); |
79 | db.StoreObject(sog2, region); | ||
80 | |||
81 | // This tests the ADO.NET driver | ||
82 | List<SceneObjectGroup> objs = db.LoadObjects(region); | ||
83 | Assert.AreEqual(2, objs.Count); | ||
84 | |||
85 | // This confirms things actually went to disk | ||
86 | db = new SQLiteRegionData(); | ||
87 | db.Initialise(connect); | ||
73 | 88 | ||
89 | List<SceneObjectGroup> objs2 = db.LoadObjects(region); | ||
90 | Assert.AreEqual(2, objs2.Count); | ||
91 | } | ||
92 | |||
93 | [Test] | ||
94 | public void T011_ObjectNames() | ||
95 | { | ||
74 | List<SceneObjectGroup> objs = db.LoadObjects(region); | 96 | List<SceneObjectGroup> objs = db.LoadObjects(region); |
75 | Assert.AreEqual(1, objs.Count); | 97 | foreach (SceneObjectGroup sog in objs) |
98 | { | ||
99 | SceneObjectPart p = sog.RootPart; | ||
100 | Assert.That("", Text.DoesNotMatch(p.Name)); | ||
101 | Assert.That(p.Name, Text.Matches(p.Description)); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | [Test] | ||
106 | public void T010_UpdateObject() | ||
107 | { | ||
108 | |||
76 | } | 109 | } |
77 | 110 | ||
78 | private SceneObjectGroup NewSOG() | 111 | |
112 | private SceneObjectGroup NewSOG(string name) | ||
79 | { | 113 | { |
80 | SceneObjectGroup sog = new SceneObjectGroup(); | 114 | SceneObjectGroup sog = new SceneObjectGroup(); |
81 | SceneObjectPart sop = new SceneObjectPart(); | 115 | SceneObjectPart sop = new SceneObjectPart(); |
82 | sop.LocalId = 1; | 116 | sop.LocalId = 1; |
83 | sop.Name = ""; | 117 | sop.Name = name; |
84 | sop.Description = ""; | 118 | sop.Description = name; |
85 | sop.Text = ""; | 119 | sop.Text = ""; |
86 | sop.SitName = ""; | 120 | sop.SitName = ""; |
87 | sop.TouchName = ""; | 121 | sop.TouchName = ""; |