- Timestamp:
- 03/03/17 18:41:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
r14711 r14713 32 32 using System.Threading.Tasks; 33 33 using HeuristicLab.Algorithms.GeneticAlgorithm; 34 using HeuristicLab.Common; 34 35 using HeuristicLab.Data; 35 36 using HeuristicLab.Persistence; … … 403 404 404 405 public string Profile(Func<object> GenerateDataFunc) { 405 int nrOfRepetitions = 30;406 int nrOfRepetitions = 1; 406 407 StringBuilder report = new StringBuilder(); 407 408 List<PerformanceData> dataList = new List<PerformanceData>(); … … 2134 2135 foreach (var fileName in Directory.EnumerateFiles(path, "*.hl")) { 2135 2136 var original = XmlParser.Deserialize(fileName); 2136 serializer.Serialize(original, fileName + ".proto"); 2137 // var newVersion = serializer.Deserialize(fileName + ".proto"); 2138 var p = Profile(() => original); 2139 Console.WriteLine(p); 2137 var ok = true; 2138 foreach (var t in original.GetObjectGraphObjects().Select(o => o.GetType())) { 2139 if ( 2140 t.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) 2141 .Any(ctor => StorableConstructorAttribute.IsStorableConstructor(ctor))) { 2142 try { 2143 if (t.IsGenericType) 2144 { 2145 var g = Mapper.StaticCache.GetGuid(t.GetGenericTypeDefinition()); 2146 } 2147 else 2148 { 2149 var g = Mapper.StaticCache.GetGuid(t); 2150 } 2151 } catch (Exception e) { 2152 Console.WriteLine(t.FullName); 2153 ok = false; 2154 } 2155 } 2156 } 2157 if (ok) { 2158 serializer.Serialize(original, fileName + ".proto"); 2159 // var newVersion = serializer.Deserialize(fileName + ".proto"); 2160 var p = Profile(() => original); 2161 Console.WriteLine(p); 2162 } 2140 2163 } 2141 2164 }
Note: See TracChangeset
for help on using the changeset viewer.