aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs2
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs53
2 files changed, 53 insertions, 2 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 986687c..8fbc80d 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -211,7 +211,7 @@ namespace OpenSim.Data.SQLite
211 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0 211 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0
212 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0) 212 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0)
213 { 213 {
214 //m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); 214 m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
215 addPrim(prim, obj.UUID, regionUUID); 215 addPrim(prim, obj.UUID, regionUUID);
216 } 216 }
217 else if (prim.Stopped) 217 else if (prim.Stopped)
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
index 725573e..af3bfae 100644
--- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
+++ b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
@@ -26,8 +26,12 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using NUnit.Framework; 30using NUnit.Framework;
31using OpenSim.Framework;
30using OpenSim.Data.SQLite; 32using OpenSim.Data.SQLite;
33using OpenSim.Region.Environment.Scenes;
34using OpenMetaverse;
31 35
32namespace OpenSim.Data.SQLite.Tests 36namespace OpenSim.Data.SQLite.Tests
33{ 37{
@@ -37,13 +41,60 @@ namespace OpenSim.Data.SQLite.Tests
37 public string file = "regiontest.db"; 41 public string file = "regiontest.db";
38 public string connect; 42 public string connect;
39 public SQLiteRegionData db; 43 public SQLiteRegionData db;
44 public UUID region = UUID.Zero;
40 45
41 [SetUp] 46 [TestFixtureSetUp]
42 public void Init() 47 public void Init()
43 { 48 {
49 log4net.Config.XmlConfigurator.Configure();
50 System.Console.WriteLine("Entering Init");
44 connect = "URI=file:" + file + ",version=3"; 51 connect = "URI=file:" + file + ",version=3";
45 db = new SQLiteRegionData(); 52 db = new SQLiteRegionData();
46 db.Initialise(connect); 53 db.Initialise(connect);
47 } 54 }
55
56 [TestFixtureTearDown]
57 public void Cleanup()
58 {
59 System.IO.File.Delete(file);
60 }
61
62 [Test]
63 public void T001_LoadEmpty()
64 {
65 System.Console.WriteLine("Entering T001");
66 List<SceneObjectGroup> objs = db.LoadObjects(region);
67 Assert.AreEqual(0, objs.Count);
68 }
69
70 [Test]
71 public void T010_StoreObject()
72 {
73 System.Console.WriteLine("Entering T010");
74 SceneObjectGroup sog = NewSOG();
75
76 db.StoreObject(sog, region);
77
78 List<SceneObjectGroup> objs = db.LoadObjects(region);
79 Assert.AreEqual(1, objs.Count);
80 }
81
82 private SceneObjectGroup NewSOG()
83 {
84 SceneObjectGroup sog = new SceneObjectGroup();
85 SceneObjectPart sop = new SceneObjectPart();
86 sop.LocalId = 1;
87 sop.Name = "";
88 sop.Description = "";
89 sop.Text = "";
90 sop.SitName = "";
91 sop.TouchName = "";
92 sop.UUID = UUID.Random();
93 sop.Shape = PrimitiveBaseShape.Default;
94 sog.AddPart(sop);
95 sog.RootPart = sop;
96 return sog;
97 }
98
48 } 99 }
49} \ No newline at end of file 100} \ No newline at end of file