diff --git a/Tests/UnitTests/TestCore/FTDistributionsTest.h b/Tests/UnitTests/TestCore/FTDistributionsTest.h index 7fe95dd0d939dace0e1bb5cf6d23a878c73a81dd..d2169901c4898f74f24b2fe03ecc2c51a544c249 100644 --- a/Tests/UnitTests/TestCore/FTDistributionsTest.h +++ b/Tests/UnitTests/TestCore/FTDistributionsTest.h @@ -21,15 +21,16 @@ TEST_F(FTDistributionsTest, FTDistribution2DCauchyConstructor) EXPECT_EQ(M_PI/2.0, iftd2D->getDelta()); EXPECT_EQ(0.0, iftd2D->getGamma()); EXPECT_EQ("2DDistributionCauchy", iftd2D->getName()); - - /*double sum_sq = qx*qx*m_coherence_length_x*m_coherence_length_x - + qy*qy*m_coherence_length_y*m_coherence_length_y; - return std::pow(1.0 + sum_sq, -1.5);*/ EXPECT_NEAR(0.343206, iftd2D->evaluate(0.2, 0.5),0.000001); iftd2D->setGamma(3.0); EXPECT_EQ(3.0, iftd2D->getGamma()); + iftd2D->setParameterValue("coherence_length_x", -7.0); + iftd2D->setParameterValue("coherence_length_y", 5.3); + EXPECT_EQ(-7.0, iftd2D->getCoherenceLengthX()); + EXPECT_EQ(5.3, iftd2D->getCoherenceLengthY()); + delete iftd2D; } @@ -46,8 +47,6 @@ TEST_F(FTDistributionsTest, FTDistribution2DCauchyClone) EXPECT_EQ("2DDistributionCauchy", iftd2DClone->getName()); EXPECT_NEAR(0.165121078, iftd2DClone->evaluate(0.2, 0.5),0.000001); - iftd2DClone->setGamma(3.0); - EXPECT_EQ(3.0, iftd2DClone->getGamma()); delete iftd2D; @@ -64,10 +63,6 @@ TEST_F(FTDistributionsTest, FTDistribution2DGaussConstructor) EXPECT_EQ(M_PI/2.0, iftd2D->getDelta()); EXPECT_EQ(0.0, iftd2D->getGamma()); EXPECT_EQ("2DDistributionGauss", iftd2D->getName()); - - /*double sum_sq = qx*qx*m_coherence_length_x*m_coherence_length_x - + qy*qy*m_coherence_length_y*m_coherence_length_y; - return std::exp(-sum_sq/4.0)/2.0;*/ EXPECT_NEAR(0.3855258, iftd2D->evaluate(0.2, 0.5),0.000001); iftd2D->setGamma(3.0); @@ -89,10 +84,6 @@ TEST_F(FTDistributionsTest, FTDistribution2DGaussClone) EXPECT_EQ("2DDistributionGauss", iftd2DClone->getName()); EXPECT_NEAR(0.279774, iftd2DClone->evaluate(0.2, 0.5),0.000001); - iftd2DClone->setGamma(3.0); - EXPECT_EQ(3.0, iftd2DClone->getGamma()); - - delete iftd2D; delete iftd2DClone; } @@ -105,11 +96,6 @@ TEST_F(FTDistributionsTest, FTDistribution2DVoigtConstructor) EXPECT_EQ(M_PI/2.0, iftd2D->getDelta()); EXPECT_EQ(0.0, iftd2D->getGamma()); EXPECT_EQ("2DDistributionVoigt", iftd2D->getName()); - - /*double sum_sq = qx*qx*m_coherence_length_x*m_coherence_length_x - + qy*qy*m_coherence_length_y*m_coherence_length_y; - return m_eta*std::exp(-sum_sq/4.0)/2.0 - + (1.0 - m_eta)*std::pow(1.0 + sum_sq, -1.5);*/ EXPECT_NEAR(0.4913253, iftd2D->evaluate(0.2, 0.5),0.000001); iftd2D->setGamma(3.0); @@ -118,8 +104,7 @@ TEST_F(FTDistributionsTest, FTDistribution2DVoigtConstructor) delete iftd2D; } -//0.165121078 -//0.279774 + TEST_F(FTDistributionsTest, FTDistribution2DVoigtClone) { IFTDistribution2D * iftd2D = new FTDistribution2DVoigt(-5.0,2.3, -5.6); @@ -132,10 +117,6 @@ TEST_F(FTDistributionsTest, FTDistribution2DVoigtClone) EXPECT_EQ("2DDistributionVoigt", iftd2DClone->getName()); EXPECT_NEAR(-0.476936, iftd2DClone->evaluate(0.2, 0.5),0.000001); - iftd2DClone->setGamma(3.0); - EXPECT_EQ(3.0, iftd2DClone->getGamma()); - - delete iftd2D; delete iftd2DClone; }