From 1f792e6b9c9b41c4da8f8996e3eb325e444b0099 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 4 Apr 2020 12:24:12 +0200 Subject: 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. --- test/unit/test_network.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/unit/test_network.cpp') 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("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(); } // --------------------------------------------------------------------------- -- cgit v1.2.3