Changeset 11939 for trunk/sources/HeuristicLab.Tests
- Timestamp:
- 02/06/15 13:28:55 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests
- Files:
-
- 1 added
- 1 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3/EnumerableBoolEqualityComparerTest.cs
r11935 r11939 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System.Collections.Generic; 23 using System.Linq; 24 using HeuristicLab.Algorithms.ParameterlessPopulationPyramid; 25 using HeuristicLab.Random; 2 26 using Microsoft.VisualStudio.TestTools.UnitTesting; 3 using HeuristicLab.Random;4 using System.Collections.Generic;5 using HeuristicLab.Algorithms.ParameterlessPopulationPyramid;6 using System.Linq;7 27 8 28 namespace ParameterlessPopulationPyramid.Test { … … 18 38 } 19 39 [TestMethod] 40 [TestProperty("Time", "short")] 41 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 20 42 public void EnumerableBoolEqualsTest() { 21 43 bool[] array = new bool[10]; … … 23 45 randFill(array, rand); 24 46 Assert.IsTrue(compare.Equals(array, array)); 25 47 26 48 // Clones equal 27 49 var another = (bool[])array.Clone(); 28 50 Assert.IsTrue(compare.Equals(array, another)); 29 51 30 52 // Flipping a bit makes unequal 31 int flip = rand.Next(array.Length -1);53 int flip = rand.Next(array.Length - 1); 32 54 another[flip] = !another[flip]; 33 55 Assert.IsFalse(compare.Equals(array, another)); … … 40 62 41 63 [TestMethod] 64 [TestProperty("Time", "short")] 65 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 42 66 public void EnumerableBoolHashCollisionTest() { 43 67 int collisions = 0; … … 46 70 randFill(array, rand); 47 71 int original = compare.GetHashCode(array); 48 72 49 73 bool[] another = (bool[])array.Clone(); 50 74 // Perform random walk around string checking for hash collisions … … 70 94 71 95 [TestMethod] 96 [TestProperty("Time", "short")] 97 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 72 98 public void EnumerableBoolHashSetTest() { 73 99 HashSet<bool[]> set = new HashSet<bool[]>(compare); -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3/LinkageTreeTest.cs
r11935 r11939 1 using System; 2 using System.Collections.Generic; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 3 22 using System.Linq; 4 23 using HeuristicLab.Algorithms.ParameterlessPopulationPyramid; … … 30 49 31 50 [TestMethod] 51 [TestProperty("Time", "short")] 52 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 32 53 public void LinkageTreeTestAdd() { 33 54 MersenneTwister rand = new MersenneTwister(); … … 44 65 45 66 [TestMethod] 67 [TestProperty("Time", "short")] 68 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 46 69 public void LinkageTreeTestEntropyDistance() { 47 70 MersenneTwister rand = new MersenneTwister(); … … 65 88 66 89 [TestMethod] 90 [TestProperty("Time", "short")] 91 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 67 92 public void LinkageTreeTestRebuild() { 68 93 // The seed matters as equal sized clusters can appear in any order -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3/ParameterlessPopulationPyramidTest.cs
r11935 r11939 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using Microsoft.VisualStudio.TestTools.UnitTesting;23 using System.Threading; 24 24 using HeuristicLab.Algorithms.ParameterlessPopulationPyramid; 25 25 using HeuristicLab.Common; 26 using Microsoft.VisualStudio.TestTools.UnitTesting; 26 27 27 28 namespace ParameterlessPopulationPyramid.Test { … … 38 39 PrivateObject hidden = new PrivateObject(solver); 39 40 try { 40 hidden.Invoke("Run" );41 hidden.Invoke("Run", new CancellationToken()); 41 42 } 42 43 catch (OperationCanceledException) { … … 45 46 46 47 Assert.AreEqual(maximumEvaluations, hidden.GetProperty("ResultsEvaluations"), "Total Evaluations"); 47 double foundQuality = 48 double foundQuality = (double)hidden.GetProperty("ResultsBestQuality"); 48 49 Assert.IsTrue(foundQuality.IsAlmost(bestQuality), string.Format("Expected <{0}> Actual <{1}>", bestQuality, foundQuality)); 49 50 Assert.AreEqual(foundOn, hidden.GetProperty("ResultsBestFoundOnEvaluation"), "Found On"); … … 51 52 return hidden; 52 53 } 53 54 54 55 [TestMethod] 56 [TestProperty("Time", "medium")] 57 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 55 58 public void P3DeceptiveTrap() { 56 59 var problem = new DeceptiveTrapProblem(); … … 66 69 // Unlike DeceptiveTrap, DeceptiveStepTrap likely contains neutral (fitness equal) modifications. 67 70 [TestMethod] 71 [TestProperty("Time", "medium")] 72 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 68 73 public void P3DeceptiveStepTrap() { 69 74 var problem = new DeceptiveStepTrapProblem(); … … 80 85 // Unlike the Trap tests, HIFF uses higher order linkage learning. 81 86 [TestMethod] 87 [TestProperty("Time", "medium")] 88 [TestCategory("Algorithms.ParameterlessPopulationPyramid")] 82 89 public void P3HIFF() { 83 90 var problem = new HIFFProblem(); -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r11916 r11939 131 131 <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3"> 132 132 <HintPath>..\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath> 133 <Private>False</Private> 134 </Reference> 135 <Reference Include="HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 136 <SpecificVersion>False</SpecificVersion> 137 <HintPath>..\bin\HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.dll</HintPath> 133 138 <Private>False</Private> 134 139 </Reference> … … 411 416 <Compile Include="HeuristicLab.Algorithms.DataAnalysis-3.4\GaussianProcessFunctionsTest.cs" /> 412 417 <Compile Include="HeuristicLab.Algorithms.DataAnalysis-3.4\GaussianProcessRegressionTest.cs" /> 418 <Compile Include="HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3\EnumerableBoolEqualityComparerTest.cs" /> 419 <Compile Include="HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3\LinkageTreeTest.cs" /> 420 <Compile Include="HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3\ParameterlessPopulationPyramidTest.cs" /> 413 421 <Compile Include="HeuristicLab.Analysis-3.3\BonferroniHolmUnitTests.cs" /> 414 422 <Compile Include="HeuristicLab.Analysis-3.3\ConfidenceIntervalsTests.cs" />
Note: See TracChangeset
for help on using the changeset viewer.