Skip to content

v0.2.54..v0.2.55 changeset OsmSchemaTest.cpp

Garret Voltz edited this page Aug 14, 2020 · 1 revision
diff --git a/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp
index 5462ad1..b7399cd 100644
--- a/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp
+++ b/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp
@@ -69,6 +69,7 @@ class OsmSchemaTest : public HootTestFixture
   CPPUNIT_TEST(hasMoreThanOneTypeTest);
   CPPUNIT_TEST(getFirstTypeTest);
   CPPUNIT_TEST(explicitTypeMismatchTest);
+  CPPUNIT_TEST(mostSpecificTypeTest);
   CPPUNIT_TEST_SUITE_END();
 
 public:
@@ -541,6 +542,26 @@ public:
     tags2["amenity"] = "ambulance_station";
     CPPUNIT_ASSERT(!uut.explicitTypeMismatch(tags1, tags2, 0.8));
   }
+
+  void mostSpecificTypeTest()
+  {
+    OsmSchema& uut = OsmSchema::getInstance();
+    Tags tags;
+
+    tags.clear();
+    tags["building"] = "yes";
+    HOOT_STR_EQUALS("building=yes", uut.mostSpecificType(tags));
+
+    tags.clear();
+    tags["building"] = "yes";
+    tags["building"] = "fort";
+    HOOT_STR_EQUALS("building=fort", uut.mostSpecificType(tags));
+
+    tags.clear();
+    tags["building"] = "yes";
+    tags["name"] = "fort";
+    HOOT_STR_EQUALS("building=yes", uut.mostSpecificType(tags));
+  }
 };
 
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(OsmSchemaTest, "slow");
Clone this wiki locally