clang-format tests

This commit is contained in:
Sarah Hoffmann
2019-11-05 23:56:18 +01:00
parent f9caba41d7
commit 069c2830ec
23 changed files with 276 additions and 189 deletions

View File

@ -7,20 +7,23 @@ static testing::db::import_t db;
TEST_CASE("compute Z order")
{
REQUIRE_NOTHROW(db.run_file(testing::opt_t().slim(),
"test_output_pgsql_z_order.osm"));
REQUIRE_NOTHROW(
db.run_file(testing::opt_t().slim(), "test_output_pgsql_z_order.osm"));
auto conn = db.db().connect();
char const *expected[] = {"motorway", "trunk", "primary",
"secondary", "tertiary"};
char const *expected[] = {"motorway", "trunk", "primary", "secondary",
"tertiary"};
for (unsigned i = 0; i < 5; ++i) {
auto sql = boost::format("SELECT highway FROM osm2pgsql_test_line"
" WHERE layer IS NULL ORDER BY z_order DESC"
" LIMIT 1 OFFSET %1%") % i;
" LIMIT 1 OFFSET %1%") %
i;
REQUIRE(expected[i] == conn.require_scalar<std::string>(sql.str()));
}
REQUIRE("residential" == conn.require_scalar<std::string>("SELECT highway FROM osm2pgsql_test_line ORDER BY z_order DESC LIMIT 1 OFFSET 0"));
REQUIRE("residential" == conn.require_scalar<std::string>(
"SELECT highway FROM osm2pgsql_test_line "
"ORDER BY z_order DESC LIMIT 1 OFFSET 0"));
}