- Timestamp:
- 03/25/19 17:18:21 (5 years ago)
- Location:
- branches/2936_GQAPIntegration/HeuristicLab.Tests
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2936_GQAPIntegration/HeuristicLab.Tests
- Property svn:mergeinfo changed
-
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/CloningConstructorTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/CollectObjectGraphTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/ContentViewTests.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.MainForm.WindowsForms;27 26 using HeuristicLab.PluginInfrastructure; 28 27 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 38 37 //get all non-generic and instantiable classes which implement IContentView 39 38 foreach (Type viewType in ApplicationManager.Manager.GetTypes(typeof(IContentView))) { 39 // jkarder: skip this test for the SymbolicDataAnalysisModelMathView (and for views that derive from it) 40 // reason: our new build agent cannot create an instance of this view due to the use of System.Windows.Forms.WebBrowser 41 if (typeof(HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisModelMathView).IsAssignableFrom(viewType)) 42 continue; 43 40 44 //get all ContentAttributes on the instantiable view 41 45 foreach (ContentAttribute attribute in viewType.GetCustomAttributes(typeof(ContentAttribute), false).Cast<ContentAttribute>()) { … … 48 52 try { 49 53 accessor.Invoke("OnContentChanged"); 50 } 51 catch (Exception ex) { 54 } catch (Exception ex) { 52 55 Assert.Fail(viewType.ToString() + Environment.NewLine + ex.Message); 53 56 } -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/GeneticAlgorithmTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/InstantiateCreatablesTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/ParameterVisibilityTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/PluginDependenciesTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/PluginLoader.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/AlpsSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/EsGriewankSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GABppSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GAGroupingProblemSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GATspSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GAVrpSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPArtificialAntSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPLawnMowerSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPMultiplexerSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPRobocodeSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicClassificationSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleWithOSTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 67 67 // been able to identify the real cause. Presumably, execution on a Xeon and a Core i7 processor 68 68 // leads to different results. 69 Assert.AreEqual(0.9 0811178793448177, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Quality differs.");70 Assert.AreEqual(0. 87264498853305739, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs.");71 Assert.AreEqual(0. 75425658608938817, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs.");72 Assert.AreEqual( 8900, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ.");73 Assert.AreEqual(0.9 0811178793448177, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs.");74 // Assert.AreEqual(0.896290231994223, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs.");69 Assert.AreEqual(0.99174959007940156, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Quality differs."); 70 Assert.AreEqual(0.9836083751914968, SamplesUtils.GetDoubleResult(osga, "CurrentAverageQuality"), 1E-8, Environment.NewLine + "Current Average Quality differs."); 71 Assert.AreEqual(0.98298394717065463, SamplesUtils.GetDoubleResult(osga, "CurrentWorstQuality"), 1E-8, Environment.NewLine + "Current Worst Quality differs."); 72 Assert.AreEqual(10100, SamplesUtils.GetIntResult(osga, "EvaluatedSolutions"), Environment.NewLine + "Evaluated Solutions differ."); 73 Assert.AreEqual(0.99174959007940156, bestTrainingSolution.TrainingRSquared, 1E-8, Environment.NewLine + "Best Training Solution Training R² differs."); 74 Assert.AreEqual(0.8962902319942232, bestTrainingSolution.TestRSquared, 1E-8, Environment.NewLine + "Best Training Solution Test R² differs."); 75 75 } else { 76 76 Assert.AreEqual(0.9971536312165723, SamplesUtils.GetDoubleResult(osga, "BestQuality"), 1E-8, Environment.NewLine + "Best Qualitiy differs."); … … 104 104 var squareroot = grammar.Symbols.OfType<SquareRoot>().Single(); 105 105 var root = grammar.Symbols.OfType<Root>().Single(); 106 var cube = grammar.Symbols.OfType<Cube>().Single(); 107 var cuberoot = grammar.Symbols.OfType<CubeRoot>().Single(); 106 108 var log = grammar.Symbols.OfType<Logarithm>().Single(); 107 109 var exp = grammar.Symbols.OfType<Exponential>().Single(); … … 130 132 grammar.AddAllowedChildSymbol(squareroot, variable); 131 133 134 cube.Enabled = false; 135 cuberoot.Enabled = false; 132 136 root.Enabled = false; 133 137 -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPTimeSeriesSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GaussianProcessRegressionSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 50 50 gpr.Seed = 1618551877; 51 51 SamplesUtils.RunAlgorithm(gpr); 52 Assert.AreEqual(-940. 60591737780555, SamplesUtils.GetDoubleResult(gpr, "NegativeLogLikelihood"));53 Assert.AreEqual(0.9956 0909041069334, SamplesUtils.GetDoubleResult(gpr, "Training R²"));52 Assert.AreEqual(-940.70700288855619, SamplesUtils.GetDoubleResult(gpr, "NegativeLogLikelihood")); 53 Assert.AreEqual(0.99563390794061979, SamplesUtils.GetDoubleResult(gpr, "Training R²")); 54 54 } 55 55 -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GeSymbolicRegressionSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/IslandGaTspSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/LocalSearchKnapsackSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/OSESGriewankSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoRastriginSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/RAPGASchedulingSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/ScatterSearchVRPSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SimulatedAnnealingRastriginSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/TabuSearchTspSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/TabuSearchVRPSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/VnsOpSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/Samples/VnsTspSampleTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/StorableTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Reflection; 26 26 using System.Text; 27 using HEAL.Attic; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 42 42 43 foreach (Type storableType in ApplicationManager.Manager.GetTypes(typeof(object)) 43 .Where(Storable ClassAttribute.IsStorableClass)) {44 .Where(StorableTypeAttribute.IsStorableType)) { 44 45 //test only types contained in HL plugin assemblies 46 if (!storableType.Namespace.StartsWith("HeuristicLab")) continue; 45 47 if (storableType.Namespace.Contains(".Tests")) continue; 46 48 if (!PluginLoader.Assemblies.Contains(storableType.Assembly)) continue; 47 49 50 if (storableType.IsEnum || storableType.IsInterface) continue; 51 var storableFields = storableType 52 .GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) 53 .Where(fi => StorableAttribute.IsStorable(fi)); 54 var storableProps = storableType 55 .GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) 56 .Where(fi => StorableAttribute.IsStorable(fi)); 57 58 // a storable constructor should be given but is not absolutely required. 59 // when there are no storable fields then a storable ctor has no real purpose. 60 if (!storableFields.Any() && !storableProps.Any()) continue; 61 48 62 IEnumerable<ConstructorInfo> ctors = storableType.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); 49 ConstructorInfo storableConstructor = ctors.Where(c => c.GetParameters().Count() == 1 && c.GetParameters().First().ParameterType == typeof( bool)).FirstOrDefault();63 ConstructorInfo storableConstructor = ctors.Where(c => c.GetParameters().Count() == 1 && c.GetParameters().First().ParameterType == typeof(HEAL.Attic.StorableConstructorFlag)).FirstOrDefault(); 50 64 if (storableConstructor == null) errorMessage.Append(Environment.NewLine + storableType.ToString() + ": No storable constructor is defined."); 51 65 else { … … 68 82 foreach (var type in ApplicationManager.Manager.GetTypes(typeof(object), onlyInstantiable: false, includeGenericTypeDefinitions: true) 69 83 .Where(t => t.Namespace != null && !t.Namespace.Contains(".Tests")) 70 .Where(t => !Storable ClassAttribute.IsStorableClass(t))) {84 .Where(t => !StorableTypeAttribute.IsStorableType(t))) { 71 85 var members = type.GetMembers(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly); 72 86 var storableConstructor = members.SingleOrDefault(m => Attribute.IsDefined(m, typeof(StorableConstructorAttribute), inherit: false)); … … 74 88 75 89 if (storableConstructor != null) { 76 errorMessage.Append(Environment.NewLine + type.Namespace + "." + type.GetPrettyName() + ": Contains a storable constructor but is not a storable class.");90 errorMessage.Append(Environment.NewLine + type.Namespace + "." + type.GetPrettyName() + ": Contains a storable constructor but is not a storable type."); 77 91 } else if (storableMembers.Any()) { 78 errorMessage.Append(Environment.NewLine + type.Namespace + "." + type.GetPrettyName() + ": Contains at least one storable member but is not a storable class.");92 errorMessage.Append(Environment.NewLine + type.Namespace + "." + type.GetPrettyName() + ": Contains at least one storable member but is not a storable type."); 79 93 } 80 94 } -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/ThreadSafeLogTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2936_GQAPIntegration/HeuristicLab.Tests/HeuristicLab-3.3/ToStringTest.cs
r15583 r16711 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.