Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/03/15 13:50:25 (10 years ago)
Author:
mkommend
Message:

#2295: Merged r11782 and r11784 into stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Tests

  • stable/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs

    r11170 r11867  
    126126    private bool ProcessEqualObjects(IDeepCloneable item, IEnumerable<object> intersections) {
    127127      bool success = true;
    128       TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":");
     128      bool headerWritten = false;
     129
    129130      foreach (object o in intersections) {
    130131        string typeName = o.GetType().FullName;
     
    133134        } else if (o is IDeepCloneable) {
    134135          string info = (o is IItem) ? ((IItem)o).ItemName + ((o is INamedItem) ? ", " + ((INamedItem)o).Name : String.Empty) : String.Empty;
     136          if (!headerWritten) {
     137            TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":");
     138            headerWritten = true;
     139          }
    135140          TestContext.WriteLine("POTENTIAL ERROR! A DEEPCLONEABLE WAS NOT DEEP CLONED (" + info + "): " + typeName);
    136141          success = false;
    137         } else
     142        } else {
     143          Array array = o as Array;
     144          if (array != null && array.Length == 0) continue; //arrays of length 0 are used inside empty collections
     145          if (!headerWritten) {
     146            TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":");
     147            headerWritten = true;
     148          }
    138149          TestContext.WriteLine("WARNING: An object of type " + typeName + " is referenced in the original and in the clone.");
     150        }
    139151      }
    140152      return success;
Note: See TracChangeset for help on using the changeset viewer.