Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
colormaphelpers_test.cc File Reference
#include <utility>
#include <vector>
#include <gtest/gtest.h>
#include <scroom/colormappable.hh>
Include dependency graph for colormaphelpers_test.cc:

Classes

struct  anonymous_namespace{colormaphelpers_test.cc}::Data
 
class  anonymous_namespace{colormaphelpers_test.cc}::ColormapHelper_Data_Tests
 

Namespaces

namespace  anonymous_namespace{colormaphelpers_test.cc}
 

Functions

 INSTANTIATE_TEST_SUITE_P (ColormapHelper_Tests, ColormapHelper_Data_Tests, ::testing::ValuesIn(helpers))
 
 ASSERT_TRUE (originalColormap !=nullptr)
 
 EXPECT_EQ (sample.expectedColors, originalColormap->colors.size())
 
 ASSERT_TRUE (colormap !=nullptr)
 
 EXPECT_EQ (sample.expectedColors, colormap->colors.size())
 
 EXPECT_EQ (originalColormap, colormap)
 
 EXPECT_THROW (helper->setMonochromeColor(Color(0, 0, 1)), std::runtime_error)
 
 EXPECT_NE (1, helper->getColormap() ->colors[0].blue)
 
helper setMonochromeColor (Blue)
 
 EXPECT_EQ (originalOriginalColormap, helper->getOriginalColormap())
 
 for (Color const &c:newColorMap->colors)
 
 EXPECT_NEAR (Blue.red, currentColor.red, accuracy)
 
 EXPECT_NE (1, helper->getColormap() ->colors.back().blue)
 

Variables

const Color anonymous_namespace{colormaphelpers_test.cc}::Blue (0, 0, 1)
 
const double anonymous_namespace{colormaphelpers_test.cc}::accuracy = 1e-6
 
const std::vector< Dataanonymous_namespace{colormaphelpers_test.cc}::helpers
 
Colormap::Ptr const originalColormap = sample.helper->getOriginalColormap()
 
Colormap::Ptr const colormap = sample.helper->getColormap()
 
Colormap::Ptr const originalOriginalColormap = helper->getOriginalColormap()
 
Colormap::Ptr const newColorMap = helper->getColormap()
 
Color const currentColor = helper->getMonochromeColor()
 

Function Documentation

◆ ASSERT_TRUE() [1/2]

ASSERT_TRUE ( colormap = nullptr)

◆ ASSERT_TRUE() [2/2]

ASSERT_TRUE ( originalColormap = nullptr)

Referenced by for(), for(), for(), and for().

Here is the caller graph for this function:

◆ EXPECT_EQ() [1/4]

EXPECT_EQ ( originalColormap  ,
colormap   
)

◆ EXPECT_EQ() [2/4]

EXPECT_EQ ( originalOriginalColormap  ,
helper->  getOriginalColormap() 
)

◆ EXPECT_EQ() [3/4]

EXPECT_EQ ( sample.  expectedColors,
colormap->colors.  size() 
)

◆ EXPECT_EQ() [4/4]

EXPECT_EQ ( sample.  expectedColors,
originalColormap->colors.  size() 
)

◆ EXPECT_NE() [1/2]

EXPECT_NE ( ,
helper->getColormap() ->colors.back().  blue 
)

◆ EXPECT_NE() [2/2]

EXPECT_NE ( ,
helper->getColormap() ->colors.  blue[0] 
)

◆ EXPECT_NEAR()

EXPECT_NEAR ( Blue.  red,
currentColor.  red,
accuracy   
)

Referenced by for().

Here is the caller graph for this function:

◆ EXPECT_THROW()

EXPECT_THROW ( helper->  setMonochromeColorColor(0, 0, 1),
std::runtime_error   
)

◆ for()

for ( Color const &c:newColorMap->  colors)
79 : newColorMap->colors)
80 {
81 EXPECT_NEAR(1, c.blue, accuracy);
82 }
EXPECT_NEAR(Blue.red, currentColor.red, accuracy)
Colormap::Ptr const newColorMap
Definition colormaphelpers_test.cc:78
const double accuracy
Definition colormaphelpers_test.cc:18
Semaphore c(0)
Here is the call graph for this function:

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( ColormapHelper_Tests  ,
ColormapHelper_Data_Tests  ,
::testing::ValuesIn(helpers)   
)

◆ setMonochromeColor()

helper setMonochromeColor ( Blue  )

Variable Documentation

◆ colormap

◆ currentColor

Color const currentColor = helper->getMonochromeColor()

◆ newColorMap

Colormap::Ptr const newColorMap = helper->getColormap()

◆ originalColormap

Colormap::Ptr const originalColormap = sample.helper->getOriginalColormap()

◆ originalOriginalColormap

Colormap::Ptr const originalOriginalColormap = helper->getOriginalColormap()