Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6921


Ignore:
Timestamp:
10/13/11 15:57:00 (13 years ago)
Author:
mkommend
Message:

#1653: Excluded subtypes of Symbol and SymbolicExpressionGrammarBase from deep cloneable check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs

    r6915 r6921  
    3737  public class DeepCloneableCloningTest {
    3838
     39    [ClassInitialize]
     40    public static void MyClassInitialize(TestContext testContext) {
     41      PluginLoader.Assemblies.Any();
     42    }
     43
    3944    public DeepCloneableCloningTest() {
    4045      excludedTypes = new HashSet<Type>();
     
    4348      excludedTypes.Add(typeof(HeuristicLab.Problems.DataAnalysis.ClassificationEnsembleSolution));
    4449      excludedTypes.Add(typeof(HeuristicLab.Problems.DataAnalysis.RegressionEnsembleSolution));
     50
     51      foreach (var symbolType in ApplicationManager.Manager.GetTypes(typeof(HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbol)))
     52        excludedTypes.Add(symbolType);
     53      foreach (var grammarType in ApplicationManager.Manager.GetTypes(typeof(HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.SymbolicExpressionGrammarBase)))
     54        excludedTypes.Add(grammarType);
    4555    }
    4656
     
    109119        try {
    110120          item = (IDeepCloneable)Activator.CreateInstance(deepCloneableType, nonPublic: false);
    111         } catch { continue; } // no default constructor
     121        }
     122        catch { continue; } // no default constructor
    112123
    113124        var clone = (IDeepCloneable)item.Clone(new Cloner());
     
    134145        string typeName = o.GetType().FullName;
    135146        if (excludedTypes.Contains(o.GetType())) {
    136           TestContext.WriteLine("Skipping excluded type " + typeName);
     147          //TestContext.WriteLine("Skipping excluded type " + typeName);
    137148        } else if (o is IDeepCloneable) {
    138149          string info = (o is IItem) ? ((IItem)o).ItemName + ((o is INamedItem) ? ", " + ((INamedItem)o).Name : String.Empty) : String.Empty;
Note: See TracChangeset for help on using the changeset viewer.