MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_raster

Function test_raster

tests/image/test-raster-image.cpp:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include <geode/tests/common.hpp>
33
34void test_raster( const geode::RasterImage2D& raster )
35{
36 geode::OpenGeodeImageException::test(
37 raster.nb_cells() == 100, "Wrong number of cells" );
38 geode::OpenGeodeImageException::test(
39 raster.nb_cells_in_direction( 0 ) == 10,
40 "Wrong number of cells in direction 0" );
41 geode::OpenGeodeImageException::test(
42 raster.nb_cells_in_direction( 1 ) == 10,
43 "Wrong number of cells in direction 1" );
44 for( const auto i : geode::LRange{ raster.nb_cells() } )
45 {
46 const geode::RGBColor color{ i, i, i };
47 geode::OpenGeodeImageException::test(
48 raster.color( i ) == color, "Wrong color for ", i );
49 }
50}
51
52void test()
53{

Callers 1

testFunction · 0.70

Calls 3

testFunction · 0.70
nb_cellsMethod · 0.45
nb_cells_in_directionMethod · 0.45

Tested by

no test coverage detected