Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/05/11 21:30:50 (13 years ago)
Author:
abeham
Message:

#1628

  • excluded static fields
  • excluded types with private default constructor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab/3.3/Tests/DeepCloneableCloningTest.cs

    r6685 r6876  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Threading;
    2625using HeuristicLab.Common;
    2726using HeuristicLab.Core;
     
    8281    #endregion
    8382
    84     private ManualResetEvent waitHandle;
    85 
    8683    [TestMethod]
    8784    [DeploymentItem("SamplesExperimentFinished.hl")]
    8885    public void TestCloningFinishedExperiment() {
    89       waitHandle = new ManualResetEvent(false);
    9086      Experiment experiment = (Experiment)XmlParser.Deserialize("SamplesExperimentFinished.hl");
    9187
     
    9490
    9591      Assert.IsTrue(ProcessEqualObjects(experiment, intersections));
    96     }
    97 
    98     private void batchrun_Stopped(object sender, EventArgs e) {
    99       waitHandle.Set();
    10092    }
    10193
     
    114106        IDeepCloneable item = null;
    115107        try {
    116           item = (IDeepCloneable)Activator.CreateInstance(deepCloneableType, nonPublic: true);
     108          item = (IDeepCloneable)Activator.CreateInstance(deepCloneableType, nonPublic: false);
    117109        } catch { continue; } // no default constructor
    118110
     
    128120
    129121    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());
    132124
    133125      return originalObjects.Intersect(clonedObjects);
Note: See TracChangeset for help on using the changeset viewer.