Skip to content
Snippets Groups Projects
Commit 1fe68d35 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

upd tests and polarized case

parent 098322c8
No related branches found
No related tags found
1 merge request!2710Use non-nullptr LayerRoughness to distinguish between real layer interfaces and automated slice interfaces
...@@ -402,7 +402,7 @@ bool ReSample::polarizing() const ...@@ -402,7 +402,7 @@ bool ReSample::polarizing() const
bool ReSample::hasRoughness() const bool ReSample::hasRoughness() const
{ {
for (const auto& slice : m_stack) for (const auto& slice : m_stack)
if (slice.topRoughness()) if (slice.topRoughness() && slice.topRoughness()->sigma() > 0)
return true; return true;
return false; return false;
} }
......
...@@ -87,15 +87,18 @@ TEST_F(MultiLayerTest, LayerInterfaces) ...@@ -87,15 +87,18 @@ TEST_F(MultiLayerTest, LayerInterfaces)
// check interfaces // check interfaces
const LayerInterface* interface0 = mLayer.layerInterface(0); const LayerInterface* interface0 = mLayer.layerInterface(0);
EXPECT_TRUE(nullptr != interface0); EXPECT_TRUE(nullptr != interface0);
EXPECT_EQ(nullptr, interface0->roughness()); EXPECT_TRUE(nullptr != interface0->roughness());
EXPECT_EQ(interface0->roughness()->sigma(), 0.0);
const LayerInterface* interface1 = mLayer.layerInterface(1); const LayerInterface* interface1 = mLayer.layerInterface(1);
EXPECT_TRUE(nullptr != interface1); EXPECT_TRUE(nullptr != interface1);
EXPECT_EQ(nullptr, interface1->roughness()); EXPECT_TRUE(nullptr != interface1->roughness());
EXPECT_EQ(interface1->roughness()->sigma(), 0.0);
const LayerInterface* interface2 = mLayer.layerInterface(2); const LayerInterface* interface2 = mLayer.layerInterface(2);
EXPECT_TRUE(nullptr != interface2); EXPECT_TRUE(nullptr != interface2);
EXPECT_EQ(nullptr, interface2->roughness()); EXPECT_TRUE(nullptr != interface2->roughness());
EXPECT_EQ(interface2->roughness()->sigma(), 0.0);
} }
TEST_F(MultiLayerTest, Clone) TEST_F(MultiLayerTest, Clone)
...@@ -117,15 +120,18 @@ TEST_F(MultiLayerTest, Clone) ...@@ -117,15 +120,18 @@ TEST_F(MultiLayerTest, Clone)
// check interfaces // check interfaces
const LayerInterface* interface0 = mLayerClone->layerInterface(0); const LayerInterface* interface0 = mLayerClone->layerInterface(0);
EXPECT_TRUE(nullptr != interface0); EXPECT_TRUE(nullptr != interface0);
EXPECT_EQ(nullptr, interface0->roughness()); EXPECT_TRUE(nullptr != interface0->roughness());
EXPECT_EQ(interface0->roughness()->sigma(), 0.0);
const LayerInterface* interface1 = mLayerClone->layerInterface(1); const LayerInterface* interface1 = mLayerClone->layerInterface(1);
EXPECT_TRUE(nullptr != interface1); EXPECT_TRUE(nullptr != interface1);
EXPECT_EQ(nullptr, interface1->roughness()); EXPECT_TRUE(nullptr != interface1->roughness());
EXPECT_EQ(interface1->roughness()->sigma(), 0.0);
const LayerInterface* interface2 = mLayerClone->layerInterface(2); const LayerInterface* interface2 = mLayerClone->layerInterface(2);
EXPECT_TRUE(nullptr != interface2); EXPECT_TRUE(nullptr != interface2);
EXPECT_EQ(nullptr, interface2->roughness()); EXPECT_TRUE(nullptr != interface2->roughness());
EXPECT_EQ(interface2->roughness()->sigma(), 0.0);
delete mLayerClone; delete mLayerClone;
} }
...@@ -145,11 +151,12 @@ TEST_F(MultiLayerTest, WithRoughness) ...@@ -145,11 +151,12 @@ TEST_F(MultiLayerTest, WithRoughness)
const LayerRoughness* roughness1 = interface1->roughness(); const LayerRoughness* roughness1 = interface1->roughness();
EXPECT_TRUE(roughness0); EXPECT_TRUE(roughness0);
EXPECT_EQ(nullptr, roughness1);
EXPECT_EQ(1.1, roughness0->sigma()); EXPECT_EQ(1.1, roughness0->sigma());
EXPECT_EQ(.3, roughness0->hurst()); EXPECT_EQ(.3, roughness0->hurst());
EXPECT_EQ(0.1, roughness0->lateralCorrLength()); EXPECT_EQ(0.1, roughness0->lateralCorrLength());
EXPECT_TRUE(roughness1);
EXPECT_EQ(roughness1->sigma(), 0.0);
} }
TEST_F(MultiLayerTest, CloneWithRoughness) TEST_F(MultiLayerTest, CloneWithRoughness)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment