aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_network.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-04-04 12:24:12 +0200
committerKristian Evers <kristianevers@gmail.com>2020-04-04 19:23:53 +0200
commit1f792e6b9c9b41c4da8f8996e3eb325e444b0099 (patch)
tree6bd265cde3ea00eb45b688ae021aee4f5eb6d818 /test/unit/test_network.cpp
parent8aab6fd948a5e9c16a352fa34a4e8cde54d5d924 (diff)
downloadPROJ-1f792e6b9c9b41c4da8f8996e3eb325e444b0099.tar.gz
PROJ-1f792e6b9c9b41c4da8f8996e3eb325e444b0099.zip
hgridshift/vgridshift: defer grid opening when grid has already been opened
Relates to #2115 With the fix of https://github.com/OSGeo/PROJ/pull/2128, transforming between EPSG:4326+3855 and EPSG:4269+5703 leads to many operations with many grids, and opening a file handle for each operation saturates the limit of 1024 file handles opened simunalteously. This fix defers grid opening when a transformation has already been instanciated with the same grid.
Diffstat (limited to 'test/unit/test_network.cpp')
-rw-r--r--test/unit/test_network.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/test_network.cpp b/test/unit/test_network.cpp
index 429a7303..db3e987f 100644
--- a/test/unit/test_network.cpp
+++ b/test/unit/test_network.cpp
@@ -127,6 +127,8 @@ TEST(networking, basic) {
ASSERT_EQ(P, nullptr);
proj_context_destroy(ctx);
+ proj_cleanup();
+
#ifdef CURL_ENABLED
// enable through env variable
ctx = proj_context_create();
@@ -141,6 +143,8 @@ TEST(networking, basic) {
putenv(const_cast<char *>("PROJ_NETWORK="));
#endif
+ proj_cleanup();
+
// still disabled
ctx = proj_context_create();
proj_grid_cache_set_enable(ctx, false);
@@ -149,6 +153,8 @@ TEST(networking, basic) {
ASSERT_EQ(P, nullptr);
proj_context_destroy(ctx);
+ proj_cleanup();
+
// enable through API
ctx = proj_context_create();
proj_grid_cache_set_enable(ctx, false);
@@ -174,6 +180,7 @@ TEST(networking, basic) {
ASSERT_EQ(P, nullptr);
#endif
proj_context_destroy(ctx);
+ proj_cleanup();
}
// ---------------------------------------------------------------------------