Changeset 12031 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs
- Timestamp:
- 02/18/15 10:54:32 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs
r11514 r12031 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 119 119 private bool ProcessEqualObjects(IDeepCloneable item, IEnumerable<object> intersections) { 120 120 bool success = true; 121 TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":"); 121 bool headerWritten = false; 122 122 123 foreach (object o in intersections) { 123 124 string typeName = o.GetType().FullName; … … 126 127 } else if (o is IDeepCloneable) { 127 128 string info = (o is IItem) ? ((IItem)o).ItemName + ((o is INamedItem) ? ", " + ((INamedItem)o).Name : String.Empty) : String.Empty; 129 if (!headerWritten) { 130 TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":"); 131 headerWritten = true; 132 } 128 133 TestContext.WriteLine("POTENTIAL ERROR! A DEEPCLONEABLE WAS NOT DEEP CLONED (" + info + "): " + typeName); 129 134 success = false; 130 } else 135 } else { 136 Array array = o as Array; 137 if (array != null && array.Length == 0) continue; //arrays of length 0 are used inside empty collections 138 if (!headerWritten) { 139 TestContext.WriteLine(Environment.NewLine + item.GetType().FullName + ":"); 140 headerWritten = true; 141 } 131 142 TestContext.WriteLine("WARNING: An object of type " + typeName + " is referenced in the original and in the clone."); 143 } 132 144 } 133 145 return success;
Note: See TracChangeset
for help on using the changeset viewer.