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

Function test

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

Source from the content-addressed store, hash-verified

50}
51
52void test()
53{
54 geode::OpenGeodeImageLibrary::initialize();
55 geode::RasterImage2D raster{ { 10, 10 } };
56 for( const auto i : geode::LRange{ raster.nb_cells() } )
57 {
58 raster.set_color( i, { i, i, i } );
59 }
60 test_raster( raster );
61 test_raster( raster.clone() );
62 const auto filename_with_spaces = absl::StrCat( " ", "test.og_img2d", " " );
63 geode::save_raster_image( raster, filename_with_spaces );
64 const auto reload = geode::load_raster_image< 2 >( filename_with_spaces );
65 test_raster( reload );
66 auto raster2 = std::move( raster );
67 geode::OpenGeodeImageException::test(
68 raster2.nb_cells() == 100, "Wrong number of cells after move" );
69}
70
71OPENGEODE_TEST( "raster" )

Callers 1

test_rasterFunction · 0.70

Calls 6

initializeFunction · 0.85
save_raster_imageFunction · 0.85
test_rasterFunction · 0.70
nb_cellsMethod · 0.45
set_colorMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected