mirror of
https://github.com/mapnik/mapnik.git
synced 2026-02-01 17:36:36 +00:00
fix directory assertion logic
This commit is contained in:
parent
b14d525968
commit
78442547f8
@ -20,8 +20,8 @@
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
inline bool make_directory(std::string const& dir) {
|
||||
return boost::filesystem::create_directory(dir);
|
||||
inline void make_directory(std::string const& dir) {
|
||||
boost::filesystem::create_directory(dir);
|
||||
}
|
||||
|
||||
TEST_CASE("image io") {
|
||||
@ -152,14 +152,16 @@ SECTION("image_util : save_to_file/save_to_stream/save_to_string")
|
||||
supported_types.push_back(std::make_tuple("webp","webp"));
|
||||
#endif
|
||||
|
||||
REQUIRE(make_directory("/tmp/mapnik-tests/"));
|
||||
std::string directory_name("/tmp/mapnik-tests/");
|
||||
make_directory(directory_name);
|
||||
REQUIRE(mapnik::util::exists(directory_name));
|
||||
|
||||
for (auto const& info : supported_types)
|
||||
{
|
||||
std::string extension;
|
||||
std::string format;
|
||||
std::tie(extension, format) = info;
|
||||
std::string filename = (boost::format("/tmp/mapnik-tests/mapnik-%1%.%2%") % named_color % extension).str();
|
||||
std::string filename = (boost::format(directory_name + "mapnik-%1%.%2%") % named_color % extension).str();
|
||||
mapnik::save_to_file(im, filename);
|
||||
std::string str = mapnik::save_to_string(im, format);
|
||||
std::ostringstream ss;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user