diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-09 18:30:17 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-09 19:45:21 +0100 |
| commit | 3cc9336b038118de424d018dd0bdd90e329ad8c1 (patch) | |
| tree | 790ceaa32d7217f7667264217ecdec6db5c5d3b9 /test/unit/pj_transform_test.cpp | |
| parent | d6dad2cee4307f6b190a96dd48942645060919cc (diff) | |
| download | PROJ-3cc9336b038118de424d018dd0bdd90e329ad8c1.tar.gz PROJ-3cc9336b038118de424d018dd0bdd90e329ad8c1.zip | |
proj.h: add proj_context_set_file_finder() and proj_context_set_search_paths() (refs #1150)
Diffstat (limited to 'test/unit/pj_transform_test.cpp')
| -rw-r--r-- | test/unit/pj_transform_test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/unit/pj_transform_test.cpp b/test/unit/pj_transform_test.cpp index ea9706dd..c2926df8 100644 --- a/test/unit/pj_transform_test.cpp +++ b/test/unit/pj_transform_test.cpp @@ -581,4 +581,36 @@ TEST(pj_transform_test, init_epsg) { pj_free(dst); } +// --------------------------------------------------------------------------- + +TEST(proj_api_h, pj_set_searchpath ) { + + const char* path = "/i_do/not/exit"; + pj_set_searchpath(1, &path); + { + auto info = proj_info(); + EXPECT_EQ(info.path_count, 1); + ASSERT_NE(info.paths, nullptr); + ASSERT_NE(info.paths[0], nullptr); + EXPECT_EQ(std::string(info.paths[0]), path); + } + + pj_set_searchpath(0, nullptr); + { + auto info = proj_info(); + EXPECT_EQ(info.path_count, 0); + EXPECT_EQ(info.paths, nullptr); + } +} + +// --------------------------------------------------------------------------- + +TEST(proj_api_h, pj_set_finder ) { + + const auto myfinder = [](const char*) -> const char* { return nullptr; }; + pj_set_finder(myfinder); + + pj_set_finder(nullptr); +} + } // namespace |
