diff options
Diffstat (limited to 'test/unit/test_factory.cpp')
| -rw-r--r-- | test/unit/test_factory.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index c10c4697..37013775 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2139,6 +2139,62 @@ TEST( } } +TEST(factory, AuthorityFactory_getAvailableGeoidmodels) { + + const std::string OSGM15{"OSGM15"}; + const std::string GEOID12B{"GEOID12B"}; + const std::string GEOID18{"GEOID18"}; + + auto checkNavd88 = [&](const std::list<std::string> &res) { + EXPECT_TRUE(res.end() != std::find(res.begin(), res.end(), GEOID12B)); + EXPECT_TRUE(res.end() != std::find(res.begin(), res.end(), GEOID18)); + EXPECT_FALSE(res.end() != std::find(res.begin(), res.end(), OSGM15)); + }; + + auto checkOdn = [&](const std::list<std::string> &res) { + EXPECT_FALSE(res.end() != std::find(res.begin(), res.end(), GEOID12B)); + EXPECT_FALSE(res.end() != std::find(res.begin(), res.end(), GEOID18)); + EXPECT_TRUE(res.end() != std::find(res.begin(), res.end(), OSGM15)); + }; + + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + + { + auto res = factory->getGeoidModels("4326"); + ASSERT_TRUE(res.empty()); + } + + { + auto res = factory->getGeoidModels("5703"); // "NAVD88 height" + checkNavd88(res); + } + { + auto res = factory->getGeoidModels("6360"); // "NAVD88 height (ftUS)" + checkNavd88(res); + } + { + auto res = factory->getGeoidModels("8228"); // "NAVD88 height (ft)" + checkNavd88(res); + } + { + auto res = factory->getGeoidModels("6357"); // "NAVD88 depth" + checkNavd88(res); + } + { + auto res = factory->getGeoidModels("6358"); // "NAVD88 depth (ftUS)" + checkNavd88(res); + } + + { + auto res = factory->getGeoidModels("5701"); // "ODN height" + checkOdn(res); + } + { + auto res = factory->getGeoidModels("5732"); // "Belfast height" + checkOdn(res); + } +} + // --------------------------------------------------------------------------- TEST_F(FactoryWithTmpDatabase, |
