diff options
| author | Alan D. Snow <alansnow21@gmail.com> | 2021-04-18 05:34:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-18 12:34:29 +0200 |
| commit | e4e2991b174ea48b67e9b41c8f356a9cf1bba081 (patch) | |
| tree | d523f7534caf2662f1b97d5e8e40b5d16886c998 /test/unit/test_factory.cpp | |
| parent | 3d1c573dc9d9f56ced597554ad9fa1643f0a0ae9 (diff) | |
| download | PROJ-e4e2991b174ea48b67e9b41c8f356a9cf1bba081.tar.gz PROJ-e4e2991b174ea48b67e9b41c8f356a9cf1bba081.zip | |
Added proj_get_celestial_body_list_from_database (#2674)
Closes #2667
Diffstat (limited to 'test/unit/test_factory.cpp')
| -rw-r--r-- | test/unit/test_factory.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index edc8b190..02033a8a 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -3441,6 +3441,39 @@ TEST(factory, getUnitList) { // --------------------------------------------------------------------------- +TEST(factory, getCelestialBodyList) { + auto ctxt = DatabaseContext::create(); + { + auto factory = AuthorityFactory::create(ctxt, std::string()); + auto list = factory->getCelestialBodyList(); + EXPECT_GT(list.size(), 1U); + bool foundPROJ = false; + bool foundESRI = false; + bool foundEarth = false; + for (const auto &info : list) { + foundESRI |= info.authName == "ESRI"; + foundPROJ |= info.authName == "PROJ"; + if (info.authName == "PROJ") { + EXPECT_EQ(info.name, "Earth"); + foundEarth = true; + } + } + EXPECT_TRUE(foundESRI); + EXPECT_TRUE(foundPROJ); + EXPECT_TRUE(foundEarth); + } + { + auto factory = AuthorityFactory::create(ctxt, "ESRI"); + auto list = factory->getCelestialBodyList(); + EXPECT_GT(list.size(), 1U); + for (const auto &info : list) { + EXPECT_EQ(info.authName, "ESRI"); + } + } +} + +// --------------------------------------------------------------------------- + TEST(factory, objectInsertion) { // Cannot nest startInsertStatementsSession |
