diff options
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index d43d68ce..60ad8f61 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -5183,4 +5183,30 @@ TEST_F(CApi, datum_ensemble) { } } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_crs_is_derived) { + { + auto wkt = + createProjectedCRS()->exportToWKT(WKTFormatter::create().get()); + auto obj = proj_create_from_wkt(m_ctxt, wkt.c_str(), nullptr, nullptr, + nullptr); + ObjectKeeper keeper(obj); + ASSERT_NE(obj, nullptr) << wkt; + + EXPECT_TRUE(proj_crs_is_derived(m_ctxt, obj)); + } + + { + auto wkt = createProjectedCRS()->baseCRS()->exportToWKT( + WKTFormatter::create().get()); + auto obj = proj_create_from_wkt(m_ctxt, wkt.c_str(), nullptr, nullptr, + nullptr); + ObjectKeeper keeper(obj); + ASSERT_NE(obj, nullptr) << wkt; + + EXPECT_FALSE(proj_crs_is_derived(m_ctxt, obj)); + } +} + } // namespace |
