From 169e42913c2348e58c29b680c5681a474260a3d1 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 26 Sep 2020 22:36:10 +0200 Subject: [PATCH] Adjusted acceptable tolerance --- FastRngTests/Double/Distributions/Beta.cs | 4 ++-- FastRngTests/Double/Distributions/Exponential.cs | 4 ++-- FastRngTests/Double/Distributions/Gamma.cs | 4 ++-- FastRngTests/Double/Distributions/InverseGamma.cs | 4 ++-- FastRngTests/Double/Distributions/Laplace.cs | 4 ++-- FastRngTests/Double/Distributions/Normal.cs | 3 +++ 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/FastRngTests/Double/Distributions/Beta.cs b/FastRngTests/Double/Distributions/Beta.cs index 5da90b9..e7f4636 100644 --- a/FastRngTests/Double/Distributions/Beta.cs +++ b/FastRngTests/Double/Distributions/Beta.cs @@ -32,8 +32,8 @@ namespace FastRngTests.Double.Distributions TestContext.WriteLine($"mean={MEAN} vs. {stats.Mean}"); TestContext.WriteLine($"variance={VARIANCE} vs {stats.Variance}"); - Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.4), "Mean is out of range"); - Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.4), "Variance is out of range"); + Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.1), "Mean is out of range"); + Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.01), "Variance is out of range"); } [Test] diff --git a/FastRngTests/Double/Distributions/Exponential.cs b/FastRngTests/Double/Distributions/Exponential.cs index 6f41ee8..872edc5 100644 --- a/FastRngTests/Double/Distributions/Exponential.cs +++ b/FastRngTests/Double/Distributions/Exponential.cs @@ -29,8 +29,8 @@ namespace FastRngTests.Double.Distributions TestContext.WriteLine($"mean={MEAN} vs. {stats.Mean}"); TestContext.WriteLine($"variance={VARIANCE} vs {stats.Variance}"); - Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.4), "Mean is out of range"); - Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.4), "Variance is out of range"); + Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.1), "Mean is out of range"); + Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.1), "Variance is out of range"); } [Test] diff --git a/FastRngTests/Double/Distributions/Gamma.cs b/FastRngTests/Double/Distributions/Gamma.cs index d02eff7..40e2563 100644 --- a/FastRngTests/Double/Distributions/Gamma.cs +++ b/FastRngTests/Double/Distributions/Gamma.cs @@ -58,8 +58,8 @@ namespace FastRngTests.Double.Distributions TestContext.WriteLine($"mean={MEAN} vs. {stats.Mean}"); TestContext.WriteLine($"variance={VARIANCE} vs {stats.Variance}"); - Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.4), "Mean is out of range"); - Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.4), "Variance is out of range"); + Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.1), "Mean is out of range"); + Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.1), "Variance is out of range"); } [Test] diff --git a/FastRngTests/Double/Distributions/InverseGamma.cs b/FastRngTests/Double/Distributions/InverseGamma.cs index 4cdfe59..45956bf 100644 --- a/FastRngTests/Double/Distributions/InverseGamma.cs +++ b/FastRngTests/Double/Distributions/InverseGamma.cs @@ -31,8 +31,8 @@ namespace FastRngTests.Double.Distributions TestContext.WriteLine($"mean={MEAN} vs. {stats.Mean}"); TestContext.WriteLine($"variance={VARIANCE} vs {stats.Variance}"); - Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.4), "Mean is out of range"); - Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.4), "Variance is out of range"); + Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.1), "Mean is out of range"); + Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.1), "Variance is out of range"); } [Test] diff --git a/FastRngTests/Double/Distributions/Laplace.cs b/FastRngTests/Double/Distributions/Laplace.cs index 7c5e1bc..462ea80 100644 --- a/FastRngTests/Double/Distributions/Laplace.cs +++ b/FastRngTests/Double/Distributions/Laplace.cs @@ -30,8 +30,8 @@ namespace FastRngTests.Double.Distributions TestContext.WriteLine($"mean={MEAN} vs. {stats.Mean}"); TestContext.WriteLine($"variance={VARIANCE} vs {stats.Variance}"); - Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.4), "Mean is out of range"); - Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.4), "Variance is out of range"); + Assert.That(stats.Mean, Is.EqualTo(MEAN).Within(0.1), "Mean is out of range"); + Assert.That(stats.Variance, Is.EqualTo(VARIANCE).Within(0.5), "Variance is out of range"); } [Test] diff --git a/FastRngTests/Double/Distributions/Normal.cs b/FastRngTests/Double/Distributions/Normal.cs index a2bc05f..5dd7808 100644 --- a/FastRngTests/Double/Distributions/Normal.cs +++ b/FastRngTests/Double/Distributions/Normal.cs @@ -10,6 +10,9 @@ namespace FastRngTests.Double.Distributions [ExcludeFromCodeCoverage] public class Normal { + [Test] + [Category(TestCategories.COVER)] + [Category(TestCategories.NORMAL)] public async Task TestNormalDistribution01() { const double DESIRED_MEAN = 2.0;