diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-01-09 23:55:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-09 23:55:39 +0100 |
| commit | 763ff547aea5e1013b49254b62fc06060eccfaaf (patch) | |
| tree | daf7a4e66059e2021a398bc80e93a120a1147bad /test/unit/pj_transform_test.cpp | |
| parent | 6d5924842035ae6b5af8a6685f5c531e667c7f18 (diff) | |
| parent | 03b8e99d388013558b1a2ec02a82af4763b26b34 (diff) | |
| download | PROJ-763ff547aea5e1013b49254b62fc06060eccfaaf.tar.gz PROJ-763ff547aea5e1013b49254b62fc06060eccfaaf.zip | |
Merge pull request #1218 from rouault/search_path
Add API in proj.h to set a file finder callback and search paths; support multiple directories in PROJ_LIB
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 |
