From d2e5380cb2325ad42917c528c52a8ad42ec0176f Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sat, 15 Aug 2009 10:54:48 -0500 Subject: * 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 --- OpenSim/Data/Tests/PropertyCompareConstraint.cs | 28 ++++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'OpenSim/Data/Tests/PropertyCompareConstraint.cs') diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs index 5f53725..d64a51e 100644 --- a/OpenSim/Data/Tests/PropertyCompareConstraint.cs +++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs @@ -69,6 +69,19 @@ namespace OpenSim.Data.Tests private bool ObjectCompare(object expected, object actual, Stack 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; -- cgit v1.1