Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8046


Ignore:
Timestamp:
06/19/12 09:49:29 (12 years ago)
Author:
abeham
Message:

#1722: Added exception handling to DeepCloneableCloningTest (before it would terminate prematurely if some exception occurred during cloning of some IDeepCloneable).

File:
1 edited

Legend:

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

    r7915 r8046  
    122122        catch { continue; } // no default constructor
    123123
    124         var clone = (IDeepCloneable)item.Clone(new Cloner());
     124        IDeepCloneable clone = null;
     125        try {
     126          clone = (IDeepCloneable)item.Clone(new Cloner());
     127        } catch (Exception e) {
     128          TestContext.WriteLine("ERROR! " + e.GetType().Name + " was thrown while cloning " + deepCloneableType.Name + ".");
     129          success = false;
     130          continue;
     131        }
    125132        var intersections = CheckTotalInequality(item, clone).Where(x => x.GetType().FullName.StartsWith("HeuristicLab"));
    126133        if (!intersections.Any()) continue;
Note: See TracChangeset for help on using the changeset viewer.