Changeset 6876 for branches/GeneralizedQAP/HeuristicLab
- Timestamp:
- 10/05/11 21:30:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab/3.3/Tests/DeepCloneableCloningTest.cs
r6685 r6876 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Threading;26 25 using HeuristicLab.Common; 27 26 using HeuristicLab.Core; … … 82 81 #endregion 83 82 84 private ManualResetEvent waitHandle;85 86 83 [TestMethod] 87 84 [DeploymentItem("SamplesExperimentFinished.hl")] 88 85 public void TestCloningFinishedExperiment() { 89 waitHandle = new ManualResetEvent(false);90 86 Experiment experiment = (Experiment)XmlParser.Deserialize("SamplesExperimentFinished.hl"); 91 87 … … 94 90 95 91 Assert.IsTrue(ProcessEqualObjects(experiment, intersections)); 96 }97 98 private void batchrun_Stopped(object sender, EventArgs e) {99 waitHandle.Set();100 92 } 101 93 … … 114 106 IDeepCloneable item = null; 115 107 try { 116 item = (IDeepCloneable)Activator.CreateInstance(deepCloneableType, nonPublic: true);108 item = (IDeepCloneable)Activator.CreateInstance(deepCloneableType, nonPublic: false); 117 109 } catch { continue; } // no default constructor 118 110 … … 128 120 129 121 private IEnumerable<object> CheckTotalInequality(object original, object clone) { 130 HashSet<object> originalObjects = new HashSet<object>(original.GetObjectGraphObjects( ).Where(x => !x.GetType().IsValueType), new ReferenceEqualityComparer());131 HashSet<object> clonedObjects = new HashSet<object>(clone.GetObjectGraphObjects( ).Where(x => !x.GetType().IsValueType), new ReferenceEqualityComparer());122 HashSet<object> originalObjects = new HashSet<object>(original.GetObjectGraphObjects(true).Where(x => !x.GetType().IsValueType), new ReferenceEqualityComparer()); 123 HashSet<object> clonedObjects = new HashSet<object>(clone.GetObjectGraphObjects(true).Where(x => !x.GetType().IsValueType), new ReferenceEqualityComparer()); 132 124 133 125 return originalObjects.Intersect(clonedObjects);
Note: See TracChangeset
for help on using the changeset viewer.