mapnik/test/unit/imaging/webp_io.cpp

28 lines
547 B
C++
Raw Permalink Normal View History

2015-05-22 05:42:18 +02:00
#if defined(HAVE_WEBP)
#include "catch.hpp"
#include <sstream>
2015-10-29 16:35:45 +01:00
#include <mapnik/image_view.hpp>
#include <mapnik/webp_io.hpp>
2022-01-26 23:25:53 +01:00
TEST_CASE("webp io")
{
SECTION("does not crash accessing view")
{
2022-01-26 23:25:53 +01:00
std::stringstream s;
mapnik::image_rgba8 im(1024, 1024);
mapnik::image_view_rgba8 view(512, 512, 1024, 1024, im);
WebPConfig config;
if (!WebPConfigInit(&config))
{
throw std::runtime_error("version mismatch");
}
save_as_webp(s, view, config, true);
}
}
#endif