Code style fix via clang-format

This commit is contained in:
mmd-osm
2018-05-06 12:45:34 +02:00
parent 508501808d
commit ecbeef702a
2 changed files with 15 additions and 12 deletions

View File

@ -21,8 +21,7 @@ lua_tagtransform_t::lua_tagtransform_t(options_t const *options)
luaL_openlibs(L);
if (luaL_dofile(L, options->tag_transform_script->c_str())) {
throw std::runtime_error(
(boost::format(
"Lua tag transform style error: %1%") %
(boost::format("Lua tag transform style error: %1%") %
lua_tostring(L, -1))
.str());
}

View File

@ -135,18 +135,22 @@ void test_outputs()
void test_lua_styles()
{
#ifdef HAVE_LUA
const char* a1[] = {"osm2pgsql", "--tag-transform-script", "non_existing.lua", "tests/liechtenstein-2013-08-03.osm.pbf"};
const char *a1[] = {"osm2pgsql", "--tag-transform-script",
"non_existing.lua",
"tests/liechtenstein-2013-08-03.osm.pbf"};
options_t options = options_t(len(a1), const_cast<char **>(a1));
try
{
std::unique_ptr<tagtransform_t> tagtransform = tagtransform_t::make_tagtransform(&options);
try {
std::unique_ptr<tagtransform_t> tagtransform =
tagtransform_t::make_tagtransform(&options);
throw std::logic_error("Expected 'No such file or directory'");
}
catch(const std::runtime_error& e)
{
if(!alg::icontains(e.what(), "No such file or directory"))
throw std::logic_error((boost::format("Expected 'No such file or directory' but instead got '%1%'") % e.what()).str());
} catch (const std::runtime_error &e) {
if (!alg::icontains(e.what(), "No such file or directory"))
throw std::logic_error(
(boost::format("Expected 'No such file or directory' but "
"instead got '%1%'") %
e.what())
.str());
}
#endif
}