[Adapdev-commits] Adapdev/src/Adapdev ObjectComparer.cs,1.4,1.5
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-11-11 04:52:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25387/src/Adapdev Modified Files: ObjectComparer.cs Log Message: Added support for mutli-threaded tests (still buggy) and transactional tests Added new ISelectQuery.AddJoin method allowing for the joining of four tables Fixed bug w/ DatabaseSchema persistence Index: ObjectComparer.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/ObjectComparer.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectComparer.cs 2 Nov 2005 13:45:13 -0000 1.4 --- ObjectComparer.cs 11 Nov 2005 04:52:46 -0000 1.5 *************** *** 1,5 **** --- 1,7 ---- using System; using System.Reflection; + using System.Runtime.Serialization; using Adapdev.Reflection; + using Adapdev.Serialization; namespace Adapdev *************** *** 14,17 **** --- 16,24 ---- } + public static bool AreEqual(ISerializable x, ISerializable y) + { + return AreBytesEqual(Serializer.SerializeToBinary(x), Serializer.SerializeToBinary(y)); + } + public static bool AreEqual(object x, object y) { *************** *** 59,62 **** --- 66,86 ---- return true; } + + public static bool AreBytesEqual(byte[] a, byte[] b) + { + int i=0; + bool same=true; + do + { + if(a[i]!=b[i]) + { + same=false; + break; + } + i++; + }while(i<a.Length); + + return same; + } } } |