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_c_api.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_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index ca41620e..964d25d9 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3899,6 +3899,37 @@ TEST_F(CApi, proj_get_units_from_database) { // --------------------------------------------------------------------------- +TEST_F(CApi, proj_get_celestial_body_list_from_database) { + { proj_celestial_body_list_destroy(nullptr); } + + { + auto list = proj_get_celestial_body_list_from_database(nullptr, nullptr, 0); + ASSERT_NE(list, nullptr); + ASSERT_NE(list[0], nullptr); + ASSERT_NE(list[0]->auth_name, nullptr); + ASSERT_NE(list[0]->name, nullptr); + proj_celestial_body_list_destroy(list); + } + { + int result_count = 0; + auto list = proj_get_celestial_body_list_from_database(nullptr, "ESRI", &result_count); + ASSERT_NE(list, nullptr); + EXPECT_GT(result_count, 1); + EXPECT_EQ(list[result_count], nullptr); + bool foundGanymede = false; + for (int i = 0; i < result_count; i++) { + EXPECT_EQ(std::string(list[i]->auth_name), "ESRI"); + if (std::string(list[i]->name) == "Ganymede") { + foundGanymede = true; + } + } + EXPECT_TRUE(foundGanymede); + proj_celestial_body_list_destroy(list); + } +} + +// --------------------------------------------------------------------------- + TEST_F(CApi, proj_normalize_for_visualization) { { |
