Missing skipping static properties for ObejctDifferences for when checking results of unit tests #3406
Labels
type:bug
Error or unexpected behaviour
type:feature
New capability or enhancement
type:test-script
Creation of unit test required
Definition of the test :
In the refactoring to remove duplicate methods done in BHoM/Test_Toolkit#474 to make use of the ObjectDifferences in the Diffing_Engine, a small detail was missed, which is that the method that was removed ruled out static properties and static fields.
The method in the Diffing_Engine does include these, which has a quite detrimental effect on comparing some system classes, so far, namely the
System.Drawing.Color
class, that has a significant list of otherSystem.Drawing.Color
properties, which then means that the comparison goes recursive until the max limit of properties to compare is hit.Like color.Red.Red.Red.Red.Red...........Red.Red.Red.Red.A
To fix this, we need to either add a bool on the BaseComparisonConfig to control if static properties and fields should be included or not, or just always rule them out in the methods in the Diffing_Enigine. First option is probably better, as giving better flexibility.
Found this by realising that the Trasform UT in Graphics_Engine had started to take 10 minutes to evaluate, and realised it was the Colors that took 70ms per colour, which ofc adds up when you compare 7k vertecies.
So, to fix I see two options:
1
2
The text was updated successfully, but these errors were encountered: