mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2025-07-29 12:05:55 +00:00
Remove use of boost::lexical_cast
One less dependency and UB sanitizer warns that boost::lexical_cast has undefined behaviour. Fixes #1028
This commit is contained in:
@ -18,8 +18,7 @@ static testing::pg::tempdb_t db;
|
||||
static int table_count(testing::pg::conn_t const &conn,
|
||||
std::string const &where = "")
|
||||
{
|
||||
return conn.require_scalar<int>("SELECT count(*) FROM test_copy_thread " +
|
||||
where);
|
||||
return conn.result_as_int("SELECT count(*) FROM test_copy_thread " + where);
|
||||
}
|
||||
|
||||
TEST_CASE("db_copy_thread_t with db_deleter_by_id_t")
|
||||
@ -46,8 +45,8 @@ TEST_CASE("db_copy_thread_t with db_deleter_by_id_t")
|
||||
t.add_buffer(std::unique_ptr<db_cmd_t>(cmd.release()));
|
||||
t.sync_and_wait();
|
||||
|
||||
REQUIRE(conn.require_scalar<int>(
|
||||
"SELECT id FROM test_copy_thread") == 42);
|
||||
REQUIRE(conn.result_as_int("SELECT id FROM test_copy_thread") ==
|
||||
42);
|
||||
}
|
||||
|
||||
SECTION("add multiple rows and sync")
|
||||
@ -67,8 +66,7 @@ TEST_CASE("db_copy_thread_t with db_deleter_by_id_t")
|
||||
t.add_buffer(std::unique_ptr<db_cmd_t>(cmd.release()));
|
||||
t.finish();
|
||||
|
||||
REQUIRE(conn.require_scalar<int>(
|
||||
"SELECT id FROM test_copy_thread") == 2);
|
||||
REQUIRE(conn.result_as_int("SELECT id FROM test_copy_thread") == 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user