First Commit
This commit is contained in:
commit
8a6c7106e3
1312 files changed
+425396
No files matched your search
@@ -0,0 +1,41 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler100 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler100() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) const {
|
||||
constexpr const double epsilon = 0.00000001;
|
||||
if (node.id() == 100000) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.timestamp() == osmium::Timestamp{"2014-01-01T00:00:00Z"});
|
||||
REQUIRE(node.uid() == 1);
|
||||
REQUIRE(!std::strcmp(node.user(), "test"));
|
||||
REQUIRE(node.changeset() == 1);
|
||||
REQUIRE(node.location().lon() == Approx(1.02).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.02).epsilon(epsilon));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler100
|
||||
|
||||
TEST_CASE("100") {
|
||||
osmium::io::Reader reader{dirname + "/1/100/data.osm"};
|
||||
|
||||
CheckBasicsHandler check_basics_handler{100, 1, 0, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 100};
|
||||
TestHandler100 test_handler;
|
||||
|
||||
osmium::apply(reader, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler101 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler101() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) const {
|
||||
constexpr const double epsilon = 0.00000001;
|
||||
if (node.id() == 101000) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == Approx(1.12).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.02).epsilon(epsilon));
|
||||
} else if (node.id() == 101001) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == Approx(1.12).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.03).epsilon(epsilon));
|
||||
} else if (node.id() == 101002) {
|
||||
} else if (node.id() == 101003) {
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler101
|
||||
|
||||
TEST_CASE("101") {
|
||||
osmium::io::Reader reader{dirname + "/1/101/data.osm"};
|
||||
|
||||
CheckBasicsHandler check_basics_handler{101, 4, 0, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 101};
|
||||
TestHandler101 test_handler;
|
||||
|
||||
osmium::apply(reader, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler102 : public osmium::handler::Handler {
|
||||
|
||||
osmium::Location location;
|
||||
|
||||
public:
|
||||
|
||||
TestHandler102() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
constexpr const double epsilon = 0.00000001;
|
||||
if (node.id() == 102000) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == Approx(1.24).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.02).epsilon(epsilon));
|
||||
location = node.location();
|
||||
} else if (node.id() == 102001) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == Approx(1.24).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.02).epsilon(epsilon));
|
||||
REQUIRE(node.location() == location);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler102
|
||||
|
||||
TEST_CASE("102") {
|
||||
osmium::io::Reader reader{dirname + "/1/102/data.osm"};
|
||||
|
||||
CheckBasicsHandler check_basics_handler{102, 2, 0, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 102};
|
||||
TestHandler102 test_handler;
|
||||
|
||||
osmium::apply(reader, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler110 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler110() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) const {
|
||||
constexpr const double epsilon = 0.00000001;
|
||||
if (node.id() == 110000) {
|
||||
REQUIRE(node.location().lon() == Approx(1.02).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.12).epsilon(epsilon));
|
||||
} else if (node.id() == 110001) {
|
||||
REQUIRE(node.location().lon() == Approx(1.07).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.13).epsilon(epsilon));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 110800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
|
||||
const char *test_id = way.tags().get_value_by_key("test:id");
|
||||
REQUIRE(test_id);
|
||||
REQUIRE(!std::strcmp(test_id, "110"));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler110
|
||||
|
||||
TEST_CASE("110") {
|
||||
osmium::io::Reader reader{dirname + "/1/110/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{110, 2, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 110};
|
||||
TestHandler110 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler111 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler111() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 111800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 4);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
|
||||
const char *test_id = way.tags().get_value_by_key("test:id");
|
||||
REQUIRE(test_id);
|
||||
REQUIRE(!std::strcmp(test_id, "111"));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler111
|
||||
|
||||
TEST_CASE("111") {
|
||||
osmium::io::Reader reader{dirname + "/1/111/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{111, 4, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 111};
|
||||
TestHandler111 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler112 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler112() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 112800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 5);
|
||||
REQUIRE(way.is_closed());
|
||||
|
||||
const char *test_id = way.tags().get_value_by_key("test:id");
|
||||
REQUIRE(test_id);
|
||||
REQUIRE(!std::strcmp(test_id, "112"));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler112
|
||||
|
||||
TEST_CASE("112") {
|
||||
osmium::io::Reader reader{dirname + "/1/112/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{112, 4, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 112};
|
||||
TestHandler112 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler113 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler113() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) const {
|
||||
constexpr const double epsilon = 0.00000001;
|
||||
if (node.id() == 113000) {
|
||||
REQUIRE(node.location().lon() == Approx(1.32).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.12).epsilon(epsilon));
|
||||
} else if (node.id() == 113001) {
|
||||
REQUIRE(node.location().lon() == Approx(1.34).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.13).epsilon(epsilon));
|
||||
} else if (node.id() == 113002) {
|
||||
REQUIRE(node.location().lon() == Approx(1.37).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.12).epsilon(epsilon));
|
||||
} else if (node.id() == 113003) {
|
||||
REQUIRE(node.location().lon() == Approx(1.38).epsilon(epsilon));
|
||||
REQUIRE(node.location().lat() == Approx(1.18).epsilon(epsilon));
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 113800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 113000);
|
||||
REQUIRE(way.nodes()[1].ref() == 113001);
|
||||
} else if (way.id() == 113801) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 113002);
|
||||
REQUIRE(way.nodes()[1].ref() == 113003);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler113
|
||||
|
||||
TEST_CASE("113") {
|
||||
osmium::io::Reader reader{dirname + "/1/113/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{113, 4, 2, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 113};
|
||||
TestHandler113 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler114 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler114() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 114800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 114000);
|
||||
REQUIRE(way.nodes()[1].ref() == 114001);
|
||||
} else if (way.id() == 114801) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 114001);
|
||||
REQUIRE(way.nodes()[1].ref() == 114002);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler114
|
||||
|
||||
TEST_CASE("114") {
|
||||
osmium::io::Reader reader{dirname + "/1/114/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{114, 3, 2, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 114};
|
||||
TestHandler114 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler115 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler115() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 115800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 115000);
|
||||
REQUIRE(way.nodes()[1].ref() == 115001);
|
||||
} else if (way.id() == 115801) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 115002);
|
||||
REQUIRE(way.nodes()[1].ref() == 115001);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler115
|
||||
|
||||
TEST_CASE("115") {
|
||||
osmium::io::Reader reader{dirname + "/1/115/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{115, 3, 2, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 115};
|
||||
TestHandler115 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler116 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler116() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 116800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE_FALSE(way.is_closed());
|
||||
REQUIRE(way.nodes()[0].ref() == 116000);
|
||||
REQUIRE(way.nodes()[1].ref() == 116001);
|
||||
} else if (way.id() == 116801) {
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
} else if (way.id() == 116802) {
|
||||
REQUIRE(way.nodes().size() == 4);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler116
|
||||
|
||||
TEST_CASE("116") {
|
||||
osmium::io::Reader reader{dirname + "/1/116/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{116, 5, 3, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 116};
|
||||
TestHandler116 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler120 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler120() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 120800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().empty());
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler120
|
||||
|
||||
TEST_CASE("120") {
|
||||
osmium::io::Reader reader{dirname + "/1/120/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{120, 0, 1, 0};
|
||||
TestHandler120 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler121 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler121() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 121800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 1);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler121
|
||||
|
||||
TEST_CASE("121") {
|
||||
osmium::io::Reader reader{dirname + "/1/121/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{121, 1, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 121};
|
||||
TestHandler121 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler122 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler122() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 122800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE(way.nodes()[0] == way.nodes()[1]);
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler122
|
||||
|
||||
TEST_CASE("122") {
|
||||
osmium::io::Reader reader{dirname + "/1/122/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{122, 1, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 122};
|
||||
TestHandler122 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler123 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler123() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 123800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE(way.nodes()[0] != way.nodes()[1]);
|
||||
REQUIRE(way.nodes()[0].location() == way.nodes()[1].location());
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler123
|
||||
|
||||
TEST_CASE("123") {
|
||||
osmium::io::Reader reader{dirname + "/1/123/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{123, 2, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 123};
|
||||
TestHandler123 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler124 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler124() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) const {
|
||||
if (way.id() == 124800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 3);
|
||||
REQUIRE(way.nodes()[0] != way.nodes()[1]);
|
||||
REQUIRE(way.nodes()[0].location() == way.nodes()[1].location());
|
||||
REQUIRE(way.nodes()[0] != way.nodes()[2]);
|
||||
REQUIRE(way.nodes()[0].location() != way.nodes()[2].location());
|
||||
} else {
|
||||
throw std::runtime_error{"Unknown ID"};
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler124
|
||||
|
||||
TEST_CASE("124") {
|
||||
osmium::io::Reader reader{dirname + "/1/124/data.osm"};
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler{index_pos, index_neg};
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler{124, 3, 1, 0};
|
||||
CheckWKTHandler check_wkt_handler{dirname, 124};
|
||||
TestHandler124 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user