Looking for a way in Delphi to do deep object comparison for me, preferably 2010 RTTI based as my objects don’t inherit from TComponent. I’m developing a test framework in DUnit and need something solid which will point out exactly which field is causing problems (serialization comparison leaves it a bit vague).
Looking for a way in Delphi to do deep object comparison for me, preferably
Share
Sort of solved this myself, implemented as a class helper for TObject so can be used everywhere if people want it. D2010 and up due to RTTI but you may be able to convert it to use original RTTI stuff.
Code below may be buggy as originally mine was for DUnit and had lots of checks in it instead of changing the result and doesn’t support TCollections or a load of other special cases but can be adapted for that by using the if-elseif-then switch in the middle.
If you have any suggestions and additions please don’t hesitate to comment so I can add them to it so other people can use this.
Have fun coding
Barry