[test][windows] ensure reader is destroyed before trying to remove file - refs #3359
This commit is contained in:
parent
c18e086026
commit
632dd7e76d
1 changed files with 11 additions and 7 deletions
|
@ -167,6 +167,9 @@ SECTION("image_util : save_to_file/save_to_stream/save_to_string")
|
|||
std::ostringstream ss;
|
||||
mapnik::save_to_stream(im, ss, format);
|
||||
CHECK(str.length() == ss.str().length());
|
||||
// wrap reader in scope to ensure the file handle is
|
||||
// released before we try to remove the file
|
||||
{
|
||||
std::unique_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(filename, extension));
|
||||
unsigned w = reader->width();
|
||||
unsigned h = reader->height();
|
||||
|
@ -176,6 +179,7 @@ SECTION("image_util : save_to_file/save_to_stream/save_to_string")
|
|||
{
|
||||
CHECK(0 == std::memcmp(im2.bytes(), im.bytes(), im.width() * im.height()));
|
||||
}
|
||||
}
|
||||
if (mapnik::util::exists(filename))
|
||||
{
|
||||
mapnik::util::remove(filename);
|
||||
|
|
Loading…
Add table
Reference in a new issue