diff options
author | Sean Dague | 2008-09-13 02:06:23 +0000 |
---|---|---|
committer | Sean Dague | 2008-09-13 02:06:23 +0000 |
commit | fcc716104b6c17232c7f60c136a50cc7af9f549c (patch) | |
tree | f65c616e7fcc69835ed8b1b67a97d9cd9a8ff62d /OpenSim | |
parent | Changed "show users" command to display only root agents, "show users full" to (diff) | |
download | opensim-SC_OLD-fcc716104b6c17232c7f60c136a50cc7af9f549c.zip opensim-SC_OLD-fcc716104b6c17232c7f60c136a50cc7af9f549c.tar.gz opensim-SC_OLD-fcc716104b6c17232c7f60c136a50cc7af9f549c.tar.bz2 opensim-SC_OLD-fcc716104b6c17232c7f60c136a50cc7af9f549c.tar.xz |
2 more InventoryItem tests, plus see if I can leave the log4net
configure in there to help me get debug messages while developing.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Tests/BasicInventoryTest.cs | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs index ee6732b..181a6a4 100644 --- a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs +++ b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Data.Tests; | |||
34 | using OpenSim.Data.SQLite; | 34 | using OpenSim.Data.SQLite; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using log4net; | ||
37 | 38 | ||
38 | namespace OpenSim.Data.SQLite.Tests | 39 | namespace OpenSim.Data.SQLite.Tests |
39 | { | 40 | { |
@@ -47,6 +48,7 @@ namespace OpenSim.Data.SQLite.Tests | |||
47 | public void Init() | 48 | public void Init() |
48 | { | 49 | { |
49 | SuperInit(); | 50 | SuperInit(); |
51 | log4net.Config.XmlConfigurator.Configure(); | ||
50 | connect = "URI=file:" + file + ",version=3"; | 52 | connect = "URI=file:" + file + ",version=3"; |
51 | db = new SQLiteInventoryStore(); | 53 | db = new SQLiteInventoryStore(); |
52 | db.Initialise(connect); | 54 | db.Initialise(connect); |
diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/BasicInventoryTest.cs index 7ba8b1f..0d15fac 100644 --- a/OpenSim/Data/Tests/BasicInventoryTest.cs +++ b/OpenSim/Data/Tests/BasicInventoryTest.cs | |||
@@ -197,6 +197,7 @@ namespace OpenSim.Data.Tests | |||
197 | } | 197 | } |
198 | 198 | ||
199 | // Item tests | 199 | // Item tests |
200 | [Test] | ||
200 | public void T100_NoItems() | 201 | public void T100_NoItems() |
201 | { | 202 | { |
202 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0)); | 203 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0)); |
@@ -205,6 +206,10 @@ namespace OpenSim.Data.Tests | |||
205 | Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(0)); | 206 | Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(0)); |
206 | } | 207 | } |
207 | 208 | ||
209 | // TODO: Feeding a bad inventory item down the data path will | ||
210 | // crash the system. This is largely due to the builder | ||
211 | // routines. That should be fixed and tested for. | ||
212 | [Test] | ||
208 | public void T101_CreatItems() | 213 | public void T101_CreatItems() |
209 | { | 214 | { |
210 | db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); | 215 | db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); |
@@ -212,6 +217,23 @@ namespace OpenSim.Data.Tests | |||
212 | db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); | 217 | db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); |
213 | Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(3)); | 218 | Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(3)); |
214 | } | 219 | } |
220 | |||
221 | [Test] | ||
222 | public void T102_CompareItems() | ||
223 | { | ||
224 | InventoryItemBase i1 = db.getInventoryItem(item1); | ||
225 | InventoryItemBase i2 = db.getInventoryItem(item2); | ||
226 | InventoryItemBase i3 = db.getInventoryItem(item3); | ||
227 | Assert.That(i1.Name, Is.EqualTo(iname1)); | ||
228 | Assert.That(i2.Name, Is.EqualTo(iname2)); | ||
229 | Assert.That(i3.Name, Is.EqualTo(iname3)); | ||
230 | Assert.That(i1.Owner, Is.EqualTo(owner1)); | ||
231 | Assert.That(i2.Owner, Is.EqualTo(owner1)); | ||
232 | Assert.That(i3.Owner, Is.EqualTo(owner1)); | ||
233 | Assert.That(i1.AssetID, Is.EqualTo(asset1)); | ||
234 | Assert.That(i2.AssetID, Is.EqualTo(asset2)); | ||
235 | Assert.That(i3.AssetID, Is.EqualTo(asset3)); | ||
236 | } | ||
215 | 237 | ||
216 | 238 | ||
217 | private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) | 239 | private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) |
@@ -220,7 +242,9 @@ namespace OpenSim.Data.Tests | |||
220 | i.ID = id; | 242 | i.ID = id; |
221 | i.Folder = parent; | 243 | i.Folder = parent; |
222 | i.Owner = owner; | 244 | i.Owner = owner; |
245 | i.Creator = owner; | ||
223 | i.Name = name; | 246 | i.Name = name; |
247 | i.Description = name; | ||
224 | i.AssetID = asset; | 248 | i.AssetID = asset; |
225 | return i; | 249 | return i; |
226 | } | 250 | } |