Replace boost::scoped_ptr within tests

This commit is contained in:
Paul Norman
2015-07-18 18:10:00 -07:00
parent 7225a667da
commit 8795dde014
13 changed files with 29 additions and 44 deletions

View File

@ -28,7 +28,6 @@ The tags of inteest are specified in hstore-match-only.style
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/common-pg.hpp"
@ -56,7 +55,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -80,7 +79,7 @@ int main(int argc, char *argv[]) {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, false));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, false));
osmdata.start();

View File

@ -16,8 +16,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include "tests/middle-tests.hpp"
#include "tests/common-pg.hpp"
@ -73,7 +71,7 @@ void run_tests(options_t options, const std::string cache_type) {
}*/
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);

View File

@ -16,8 +16,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include "tests/middle-tests.hpp"
#include "tests/common-pg.hpp"
@ -64,7 +62,7 @@ void run_tests(options_t options, const std::string cache_type) {
}
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -47,7 +46,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -47,7 +46,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -73,7 +72,7 @@ int main(int argc, char *argv[]) {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -52,7 +51,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -88,7 +87,7 @@ int main(int argc, char *argv[]) {
osmdata_t osmdata(mid_pgsql, outputs);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -47,7 +46,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -74,7 +73,7 @@ int main(int argc, char *argv[]) {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -110,7 +109,7 @@ void check_output_poly_trivial(bool enable_multi, std::string conninfo) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -47,7 +46,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -73,7 +72,7 @@ int main(int argc, char *argv[]) {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();

View File

@ -19,7 +19,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -47,7 +46,7 @@ void check_count(pg::conn_ptr &conn, int expected, const std::string &query) {
}
int main(int argc, char *argv[]) {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);

View File

@ -20,7 +20,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -83,7 +82,7 @@ void assert_has_table(pg::conn_ptr &test_conn, const std::string &table_name) {
// the python script. this is just to check everything is
// working as expected before we start the complex stuff.
void test_regression_simple() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -111,7 +110,7 @@ void test_regression_simple() {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();

View File

@ -20,7 +20,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -104,7 +103,7 @@ void assert_has_table(pg::conn_ptr &test_conn, const std::string &table_name) {
// the python script. this is just to check everything is
// working as expected before we start the complex stuff.
void test_z_order() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -127,7 +126,7 @@ void test_z_order() {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, false));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, false));
osmdata.start();

View File

@ -20,7 +20,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include "tests/middle-tests.hpp"
@ -104,7 +103,7 @@ void assert_has_table(pg::conn_ptr &test_conn, const std::string &table_name) {
// the python script. this is just to check everything is
// working as expected before we start the complex stuff.
void test_regression_simple() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -128,7 +127,7 @@ void test_regression_simple() {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();
@ -164,7 +163,7 @@ void test_regression_simple() {
}
void test_latlong() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -191,7 +190,7 @@ void test_latlong() {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();
@ -228,7 +227,7 @@ void test_latlong() {
void test_area_way_simple() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -254,7 +253,7 @@ void test_area_way_simple() {
osmdata_t osmdata(mid_pgsql, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();
@ -279,7 +278,7 @@ void test_area_way_simple() {
}
void test_route_rel() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -303,7 +302,7 @@ void test_route_rel() {
osmdata_t osmdata(mid_ram, out_test);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();
@ -330,7 +329,7 @@ void test_route_rel() {
// test the same, but clone the output. it should
// behave the same as the original.
void test_clone() {
boost::scoped_ptr<pg::tempdb> db;
std::unique_ptr<pg::tempdb> db;
try {
db.reset(new pg::tempdb);
@ -358,7 +357,7 @@ void test_clone() {
osmdata_t osmdata(mid_pgsql, out_clone);
boost::scoped_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
std::unique_ptr<parse_delegate_t> parser(new parse_delegate_t(options.extra_attributes, options.bbox, options.projection, options.append));
osmdata.start();