osrm-backend/test/osm-testdata/testcases/test-101.cpp
Dennis Luxen 73efcc6b0c Squashed 'third_party/libosmium/' content from commit 910f8f1
git-subtree-dir: third_party/libosmium
git-subtree-split: 910f8f1e992402e0f1acd0132eaffa7539ca83d2
2015-01-13 16:54:25 +01:00

44 lines
1.1 KiB
C++

#include "common.hpp"
class TestHandler101 : public osmium::handler::Handler {
public:
TestHandler101() :
osmium::handler::Handler() {
}
void node(osmium::Node& node) {
if (node.id() == 101000) {
REQUIRE(node.version() == 1);
REQUIRE(node.location().lon() == 1.12);
REQUIRE(node.location().lat() == 1.02);
} else if (node.id() == 101001) {
REQUIRE(node.version() == 1);
REQUIRE(node.location().lon() == 1.12);
REQUIRE(node.location().lat() == 1.03);
} else if (node.id() == 101002) {
} else if (node.id() == 101003) {
} else {
throw std::runtime_error("Unknown ID");
}
}
}; // class TestHandler101
TEST_CASE("101") {
SECTION("test 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);
}
}