fix compile of copy_move_test.cpp
This commit is contained in:
parent
0685c43802
commit
2ae3dfa8b3
1 changed files with 17 additions and 22 deletions
|
@ -19,11 +19,6 @@ SECTION("layers") {
|
|||
{
|
||||
mapnik::Map m0(100,100);
|
||||
mapnik::Map m2(200,100);
|
||||
// FIXME: not compiling when ported to catch.hpp
|
||||
// due to some conflict: 'include/mapnik/value.hpp:832:11: error: no matching constructor for initialization of 'value_base''
|
||||
/*
|
||||
|
||||
// mapnik::datasource
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/shape.input");
|
||||
mapnik::parameters p;
|
||||
p["type"]="shape";
|
||||
|
@ -32,29 +27,30 @@ SECTION("layers") {
|
|||
auto ds0 = mapnik::datasource_cache::instance().create(p);
|
||||
|
||||
auto ds1 = ds0; // shared ptr copy
|
||||
REQUIRE(ds1 == ds0);
|
||||
//REQUIRE(*ds1 == *ds0);
|
||||
REQUIRE( (ds1 == ds0) );
|
||||
REQUIRE( (*ds1 != *ds0) );
|
||||
REQUIRE( (ds1.get() == ds0.get()) );
|
||||
ds1 = mapnik::datasource_cache::instance().create(p); // new with the same parameters
|
||||
REQUIRE(ds1 != ds0);
|
||||
REQUIRE(*ds1 == *ds0);
|
||||
REQUIRE( (ds1 != ds0) );
|
||||
REQUIRE( (*ds1 == *ds0) );
|
||||
auto ds2 = std::move(ds1);
|
||||
REQUIRE(ds2 != ds0);
|
||||
REQUIRE(*ds2 == *ds0);
|
||||
REQUIRE( (ds2 != ds0) );
|
||||
REQUIRE( (*ds2 == *ds0) );
|
||||
|
||||
// mapnik::layer
|
||||
mapnik::layer l0("test-layer");
|
||||
l0.set_datasource(ds0);
|
||||
|
||||
mapnik::layer l1 = l0; // copy assignment
|
||||
REQUIRE(l1 == l0);
|
||||
REQUIRE( (l1 == l0) );
|
||||
mapnik::layer l2(l0); // copy ctor
|
||||
REQUIRE(l2 == l0);
|
||||
REQUIRE( (l2 == l0) );
|
||||
mapnik::layer l3(mapnik::layer("test-layer")); // move ctor
|
||||
l3.set_datasource(ds2);
|
||||
|
||||
REQUIRE(l3 == l0);
|
||||
REQUIRE( (l3 == l0) );
|
||||
mapnik::layer l4 = std::move(l3);
|
||||
REQUIRE(l4 == l0); // move assignment
|
||||
REQUIRE( (l4 == l0) ); // move assignment
|
||||
|
||||
m0.add_layer(l4);
|
||||
m0.set_background(mapnik::color("skyblue"));
|
||||
|
@ -62,17 +58,16 @@ SECTION("layers") {
|
|||
|
||||
auto m1 = m0; //copy
|
||||
|
||||
REQUIRE(m0 == m1);
|
||||
REQUIRE(m0 != m2);
|
||||
REQUIRE( (m0 == m1) );
|
||||
REQUIRE( (m0 != m2) );
|
||||
|
||||
m2 = m1; // copy
|
||||
REQUIRE(m2 == m1);
|
||||
REQUIRE( (m2 == m1) );
|
||||
m2 = std::move(m1);
|
||||
REQUIRE(m2 == m0);
|
||||
REQUIRE(m1 != m0);
|
||||
REQUIRE( (m2 == m0) );
|
||||
REQUIRE( (m1 != m0) );
|
||||
|
||||
REQUIRE(m0 == m2);
|
||||
*/
|
||||
REQUIRE( (m0 == m2) );
|
||||
}
|
||||
catch (std::exception const & ex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue