mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
* Fixed MySQL/MySQLAssetData.cs to properly do updates * Removed an extra parameter from MySQL/MySQLInventoryData.cs * Fixed a bug in SQLite/SQLiteAssetData.cs that was causing a NRE when updating an asset. * Improved the BasicAssetTest.cs to do full create/update/get testing * Improved the BasicInventoryTest.cs to do full create/update/get of both a folder and an item * Moved the null ref tests to the start of the PropertyCompareConstraint.cs, so that it doesn't throw when passing in a null item
This commit is contained in:
committed by
Teravus Ovares (Dan Olivares)
parent
f6251ce810
commit
d2e5380cb2
@@ -69,6 +69,19 @@ namespace OpenSim.Data.Tests
|
||||
|
||||
private bool ObjectCompare(object expected, object actual, Stack<string> propertyNames)
|
||||
{
|
||||
//If they are both null, they are equal
|
||||
if (actual == null && expected == null)
|
||||
return true;
|
||||
|
||||
//If only one is null, then they aren't
|
||||
if (actual == null || expected == null)
|
||||
{
|
||||
failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
|
||||
failingActual = actual;
|
||||
failingExpected = expected;
|
||||
return false;
|
||||
}
|
||||
|
||||
//prevent loops...
|
||||
if(propertyNames.Count > 50)
|
||||
{
|
||||
@@ -195,21 +208,6 @@ namespace OpenSim.Data.Tests
|
||||
object actualValue = property.GetValue(actual, null);
|
||||
object expectedValue = property.GetValue(expected, null);
|
||||
|
||||
//If they are both null, they are equal
|
||||
if (actualValue == null && expectedValue == null)
|
||||
continue;
|
||||
|
||||
//If only one is null, then they aren't
|
||||
if (actualValue == null || expectedValue == null)
|
||||
{
|
||||
propertyNames.Push(property.Name);
|
||||
failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
|
||||
propertyNames.Pop();
|
||||
failingActual = actualValue;
|
||||
failingExpected = expectedValue;
|
||||
return false;
|
||||
}
|
||||
|
||||
propertyNames.Push(property.Name);
|
||||
if (!ObjectCompare(expectedValue, actualValue, propertyNames))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user