Changeset 15228


Ignore:
Timestamp:
07/13/17 15:04:40 (2 months ago)
Author:
abeham
Message:

#2797: reduced precision in unit test to 1e-08 and renamed test class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoRastriginSampleTest.cs

    r15223 r15228  
    3131namespace HeuristicLab.Tests {
    3232  [TestClass]
    33   public class PsoSchwefelSampleTest {
     33  public class PsoRastriginSampleTest {
    3434    private const string SampleFileName = "PSO_Rastrigin";
    3535
     
    5151      if (Environment.Is64BitProcess) {
    5252        Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality"));
    53         Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"));
    54         Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"));
     53        Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08);
     54        Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08);
    5555        Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations"));
    5656      } else {
    5757        Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality"));
    58         Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"));
    59         Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"));
     58        Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08);
     59        Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08);
    6060        Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations"));
    6161      }
Note: See TracChangeset for help on using the changeset viewer.