diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2020-01-08 19:42:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-08 19:42:22 +0100 |
| commit | 2d76bcffdc4d154860512c904c877ad086ca6b6d (patch) | |
| tree | fb7a89bad15edbd55aab154532911933af591dc8 /test/unit | |
| parent | 6cd3a80bf5d015ec9c6dc601720a418c17ffa340 (diff) | |
| parent | 6426bcbd3605bf8cd6ae5c7869931fa89a26d641 (diff) | |
| download | PROJ-2d76bcffdc4d154860512c904c877ad086ca6b6d.tar.gz PROJ-2d76bcffdc4d154860512c904c877ad086ca6b6d.zip | |
Merge pull request #1827 from rouault/improve_createObjectsFromName
Improvements regarding name aliases (refs #1823)
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_c_api.cpp | 2 | ||||
| -rw-r--r-- | test/unit/test_factory.cpp | 8 | ||||
| -rw-r--r-- | test/unit/test_io.cpp | 12 |
3 files changed, 10 insertions, 12 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 78e6bced..a657c61e 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -1668,7 +1668,7 @@ TEST_F(CApi, proj_create_from_name) { false, 0, nullptr); ASSERT_NE(res, nullptr); ObjListKeeper keeper_res(res); - EXPECT_EQ(proj_list_get_count(res), 4); + EXPECT_EQ(proj_list_get_count(res), 5); } { auto res = proj_create_from_name(m_ctxt, "xx", "WGS 84", nullptr, 0, diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 0d47bfc3..8ae58c96 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -2733,8 +2733,8 @@ TEST(factory, createObjectsFromName) { EXPECT_EQ(factory->createObjectsFromName("").size(), 0U); - // ellipsoid + 3 geodeticCRS - EXPECT_EQ(factory->createObjectsFromName("WGS 84", {}, false).size(), 4U); + // ellipsoid + datum + 3 geodeticCRS + EXPECT_EQ(factory->createObjectsFromName("WGS 84", {}, false).size(), 5U); EXPECT_EQ(factory->createObjectsFromName("WGS 84", {}, true, 10).size(), 10U); @@ -2749,7 +2749,9 @@ TEST(factory, createObjectsFromName) { auto res = factoryEPSG->createObjectsFromName( "WGS84", {AuthorityFactory::ObjectType::GEOGRAPHIC_2D_CRS}, true); EXPECT_EQ(res.size(), - 8U); // EPSG:4326 and EPSG:4030 and the 6 WGS84 realizations + 9U); // EPSG:4326 and EPSG:4030 and the 6 WGS84 realizations + // and EPSG:7881 'Tritan St. Helena'' whose alias is + // 'WGS 84 Tritan St. Helena' if (!res.empty()) { EXPECT_EQ(res.front()->getEPSGCode(), 4326); } diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index d165157d..fd38847c 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -493,18 +493,14 @@ TEST(wkt_parse, wkt1_geographic_old_datum_name_from_EPSG_code) { // --------------------------------------------------------------------------- -TEST(wkt_parse, wkt1_geographic_old_datum_name_witout_EPSG_code) { +TEST(wkt_parse, wkt1_geographic_old_datum_name_without_EPSG_code) { auto wkt = "GEOGCS[\"S-JTSK (Ferro)\",\n" " " "DATUM[\"System_Jednotne_Trigonometricke_Site_Katastralni_Ferro\",\n" - " SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,\n" - " AUTHORITY[\"EPSG\",\"7004\"]]],\n" - " PRIMEM[\"Ferro\",-17.66666666666667,\n" - " AUTHORITY[\"EPSG\",\"8909\"]],\n" - " UNIT[\"degree\",0.0174532925199433,\n" - " AUTHORITY[\"EPSG\",\"9122\"]],\n" - " AUTHORITY[\"EPSG\",\"4818\"]]"; + " SPHEROID[\"Bessel 1841\",6377397.155,299.1528128]],\n" + " PRIMEM[\"Ferro\",-17.66666666666667],\n" + " UNIT[\"degree\",0.0174532925199433]]"; auto obj = WKTParser() .attachDatabaseContext(DatabaseContext::create()) .createFromWKT(wkt); |
