Various minor changes in the data tests
parent
9976cb93ce
commit
89b7c64b6f
|
@ -106,10 +106,18 @@ namespace OpenSim.Data.Tests
|
||||||
|
|
||||||
protected override void InitService(object service)
|
protected override void InitService(object service)
|
||||||
{
|
{
|
||||||
|
ClearDB();
|
||||||
m_db = (TAssetData)service;
|
m_db = (TAssetData)service;
|
||||||
m_db.Initialise(m_connStr);
|
m_db.Initialise(m_connStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ClearDB()
|
||||||
|
{
|
||||||
|
DropTables("assets");
|
||||||
|
ResetMigrations("AssetStore");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T001_LoadEmpty()
|
public void T001_LoadEmpty()
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,9 +183,10 @@ namespace OpenSim.Data.Tests
|
||||||
lst += ", " + s;
|
lst += ", " + s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string sCond = stores.Length > 1 ? ("in (" + lst + ")") : ("=" + lst);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ExecuteSql("DELETE FROM `migrations` where name in (" + lst + ");");
|
ExecuteSql("DELETE FROM migrations where name " + sCond);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,17 +108,7 @@ namespace OpenSim.Data.Tests
|
||||||
private void ClearDB()
|
private void ClearDB()
|
||||||
{
|
{
|
||||||
// if a new table is added, it has to be dropped here
|
// if a new table is added, it has to be dropped here
|
||||||
ExecuteSql("delete from migrations where name='EstateStore';");
|
|
||||||
|
|
||||||
DropTables(
|
DropTables(
|
||||||
"prims",
|
|
||||||
"primshapes",
|
|
||||||
"primitems",
|
|
||||||
"terrain",
|
|
||||||
"land",
|
|
||||||
"landaccesslist",
|
|
||||||
"regionban",
|
|
||||||
"regionsettings",
|
|
||||||
"estate_managers",
|
"estate_managers",
|
||||||
"estate_groups",
|
"estate_groups",
|
||||||
"estate_users",
|
"estate_users",
|
||||||
|
@ -126,6 +116,7 @@ namespace OpenSim.Data.Tests
|
||||||
"estate_settings",
|
"estate_settings",
|
||||||
"estate_map"
|
"estate_map"
|
||||||
);
|
);
|
||||||
|
ResetMigrations("EstateStore");
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 0Tests
|
#region 0Tests
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace OpenSim.Data.Tests
|
||||||
private void ClearDB()
|
private void ClearDB()
|
||||||
{
|
{
|
||||||
DropTables("inventoryitems", "inventoryfolders");
|
DropTables("inventoryitems", "inventoryfolders");
|
||||||
ExecuteSql("delete from migrations where name='Inventory'");
|
ResetMigrations("InventoryStore");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -194,8 +194,10 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T013_FolderHierarchy()
|
public void T013_FolderHierarchy()
|
||||||
{
|
{
|
||||||
Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
|
||||||
Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
|
Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
||||||
|
n = db.getFolderHierarchy(folder1).Count;
|
||||||
|
Assert.That(n, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
|
||||||
Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
|
Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
|
||||||
Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0))");
|
Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0))");
|
||||||
Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0))");
|
Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0))");
|
||||||
|
|
|
@ -118,8 +118,8 @@ namespace OpenSim.Data.Tests
|
||||||
m_rebuildDB = rebuild;
|
m_rebuildDB = rebuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RegionTests() : this("", false) { }
|
public RegionTests() : this("", true) { }
|
||||||
public RegionTests(string conn) : this(conn, false) {}
|
public RegionTests(string conn) : this(conn, true) {}
|
||||||
public RegionTests(bool rebuild): this("", rebuild) {}
|
public RegionTests(bool rebuild): this("", rebuild) {}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue