| 50 | } |
| 51 | |
| 52 | void 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 | |
| 71 | OPENGEODE_TEST( "raster" ) |
no test coverage detected