diff --git a/src/4D_api.cpp b/src/4D_api.cpp index 71393dab17..dabd44a036 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1487,7 +1487,7 @@ PJ_INFO proj_info (void) { // Env var mostly for testing purposes and being independent from // an existing installation const char* ignoreUserWritableDirectory = - getenv("PROJ_IGNORE_USER_WRITABLE_DIRECTORY"); + getenv("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY"); if( ignoreUserWritableDirectory == nullptr || ignoreUserWritableDirectory[0] == '\0' ) { buf = path_append(buf, diff --git a/src/filemanager.cpp b/src/filemanager.cpp index 0763181b99..005e734baa 100644 --- a/src/filemanager.cpp +++ b/src/filemanager.cpp @@ -1258,13 +1258,11 @@ static const char *proj_lib_name = nullptr; #endif -static bool ignoreUserWritableDirectory() { +static bool dontReadUserWritableDirectory() { // Env var mostly for testing purposes and being independent from // an existing installation - const char *envVarIgnoreUserWritableDirectory = - getenv("PROJ_IGNORE_USER_WRITABLE_DIRECTORY"); - return envVarIgnoreUserWritableDirectory != nullptr && - envVarIgnoreUserWritableDirectory[0] != '\0'; + const char *envVar = getenv("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY"); + return envVar != nullptr && envVar[0] != '\0'; } static void * @@ -1336,7 +1334,7 @@ pj_open_lib_internal(projCtx ctx, const char *name, const char *mode, } } - else if (!ignoreUserWritableDirectory() && + else if (!dontReadUserWritableDirectory() && (fid = open_file( ctx, (pj_context_get_user_writable_directory(ctx, false) + DIR_CHAR + name) diff --git a/src/grids.cpp b/src/grids.cpp index 24fcfe83fb..68bf860020 100644 --- a/src/grids.cpp +++ b/src/grids.cpp @@ -1837,17 +1837,20 @@ std::unique_ptr NTv2GridSet::open(PJ_CONTEXT *ctx, pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); return nullptr; } - if (memcmp(header + 56, "SECONDS", 7) != 0) { + + constexpr int OFFSET_GS_TYPE = 56; + if (memcmp(header + OFFSET_GS_TYPE, "SECONDS", 7) != 0) { pj_log(ctx, PJ_LOG_ERROR, "Only GS_TYPE=SECONDS is supported"); pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); return nullptr; } const bool must_swap = (header[8] == 11) ? !IS_LSB : IS_LSB; + constexpr int OFFSET_NUM_SUBFILES = 8 + 32; if (must_swap) { // swap_words( header+8, 4, 1 ); // swap_words( header+8+16, 4, 1 ); - swap_words(header + 8 + 32, 4, 1); + swap_words(header + OFFSET_NUM_SUBFILES, 4, 1); // swap_words( header+8+7*16, 8, 1 ); // swap_words( header+8+8*16, 8, 1 ); // swap_words( header+8+9*16, 8, 1 ); @@ -1858,7 +1861,7 @@ std::unique_ptr NTv2GridSet::open(PJ_CONTEXT *ctx, /* Get the subfile count out ... all we really use for now. */ /* -------------------------------------------------------------------- */ unsigned int num_subfiles; - memcpy(&num_subfiles, header + 8 + 32, 4); + memcpy(&num_subfiles, header + OFFSET_NUM_SUBFILES, 4); std::map mapGrids; @@ -1878,25 +1881,31 @@ std::unique_ptr NTv2GridSet::open(PJ_CONTEXT *ctx, } // Byte swap interesting fields if needed. + constexpr int OFFSET_GS_COUNT = 8 + 16 * 10; + constexpr int OFFSET_SOUTH_LAT = 8 + 16 * 4; if (must_swap) { - swap_words(header + 8 + 16 * 4, sizeof(double), 6); - swap_words(header + 8 + 16 * 10, sizeof(int), 1); + // 6 double values: southLat, northLat, eastLon, westLon, resLat, + // resLon + swap_words(header + OFFSET_SOUTH_LAT, sizeof(double), 6); + swap_words(header + OFFSET_GS_COUNT, sizeof(int), 1); } std::string gridName; gridName.append(header + 8, 8); ExtentAndRes extent; - extent.westLon = - -to_double(header + 7 * 16 + 8) * DEG_TO_RAD / 3600.0; /* W_LONG */ - extent.southLat = - to_double(header + 4 * 16 + 8) * DEG_TO_RAD / 3600.0; /* S_LAT */ - extent.eastLon = - -to_double(header + 6 * 16 + 8) * DEG_TO_RAD / 3600.0; /* E_LONG */ - extent.northLat = - to_double(header + 5 * 16 + 8) * DEG_TO_RAD / 3600.0; /* N_LAT */ - extent.resLon = to_double(header + 9 * 16 + 8) * DEG_TO_RAD / 3600.0; - extent.resLat = to_double(header + 8 * 16 + 8) * DEG_TO_RAD / 3600.0; + extent.southLat = to_double(header + OFFSET_SOUTH_LAT) * DEG_TO_RAD / + 3600.0; /* S_LAT */ + extent.northLat = to_double(header + OFFSET_SOUTH_LAT + 16) * + DEG_TO_RAD / 3600.0; /* N_LAT */ + extent.eastLon = -to_double(header + OFFSET_SOUTH_LAT + 16 * 2) * + DEG_TO_RAD / 3600.0; /* E_LONG */ + extent.westLon = -to_double(header + OFFSET_SOUTH_LAT + 16 * 3) * + DEG_TO_RAD / 3600.0; /* W_LONG */ + extent.resLat = + to_double(header + OFFSET_SOUTH_LAT + 16 * 4) * DEG_TO_RAD / 3600.0; + extent.resLon = + to_double(header + OFFSET_SOUTH_LAT + 16 * 5) * DEG_TO_RAD / 3600.0; if (!(fabs(extent.westLon) <= 4 * M_PI && fabs(extent.eastLon) <= 4 * M_PI && @@ -1923,7 +1932,7 @@ std::unique_ptr NTv2GridSet::open(PJ_CONTEXT *ctx, extent.northLat * RAD_TO_DEG); unsigned int gs_count; - memcpy(&gs_count, header + 8 + 16 * 10, 4); + memcpy(&gs_count, header + OFFSET_GS_COUNT, 4); if (gs_count / columns != static_cast(rows)) { pj_log(ctx, PJ_LOG_ERROR, "GS_COUNT(%u) does not match expected cells (%dx%d)", @@ -2845,6 +2854,7 @@ ListOfHGrids pj_hgrid_init(PJ *P, const char *gridkey) { typedef struct { pj_int32 lam, phi; } ILP; +// Apply bilinear interpolation for horizontal shift grids static PJ_LP pj_hgrid_interpolate(PJ_LP t, const HorizontalShiftGrid *grid, bool compensateNTConvention) { PJ_LP val, frct; @@ -3283,6 +3293,8 @@ const GenericShiftGrid *pj_find_generic_grid(const ListOfGenericGrids &grids, // --------------------------------------------------------------------------- +// Used by +proj=deformation and +proj=xyzgridshift to do bilinear interpolation +// on 3 sample values per node. bool pj_bilinear_interpolation_three_samples(const GenericShiftGrid *grid, const PJ_LP &lp, int idx1, int idx2, int idx3, double &v1, diff --git a/src/proj_internal.h b/src/proj_internal.h index bb0e345352..a587c0379b 100644 --- a/src/proj_internal.h +++ b/src/proj_internal.h @@ -682,7 +682,7 @@ struct projGridChunkCache { bool enabled = true; std::string filename{}; - long long max_size = 100 * 1024 * 1024; + long long max_size = 300 * 1024 * 1024; int ttl = 86400; // 1 day }; diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 42ee466d15..417ec137e1 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -29,7 +29,7 @@ EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \ CMakeLists.txt testprojinfo-check: - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTPROJINFO) $(PROJINFOEXE) + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTPROJINFO) $(PROJINFOEXE) test27-check: $(TEST27) $(PROJEXE) @@ -41,24 +41,24 @@ testproj-check: $(TESTPROJ) $(PROJEXE) testvarious-check: - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE) + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE) testdatumfile-check: @if [ -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat -a -f $(PROJ_LIB)/MD -a -f $(PROJ_LIB)/ntf_r93.gsb -a -f $(PROJ_LIB)/egm96_15.gtx ]; then \ - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) ; \ + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTDATUMFILE) $(CS2CSEXE) ; \ fi testign-check: @if [ -f $(PROJ_LIB)/ntf_r93.gsb ] ; then \ - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) ; \ + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTIGN) $(CS2CSEXE) ; \ fi testntv2-check: @if [ -f $(PROJ_LIB)/ntv2_0.gsb -a -f $(PROJ_LIB)/conus -a -f $(PROJ_LIB)/ntv1_can.dat ] ; then \ - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) ; \ + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTNTV2) $(CS2CSEXE) ; \ fi testcct-check: - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTCCT) $(CCTEXE) + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTCCT) $(CCTEXE) check-local: testprojinfo-check test27-check test83-check testproj-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check diff --git a/test/gie/Makefile.am b/test/gie/Makefile.am index 783dfb7caa..560fea0b7b 100644 --- a/test/gie/Makefile.am +++ b/test/gie/Makefile.am @@ -15,33 +15,33 @@ EXTRA_DIST = 4D-API_cs2cs-style.gie \ PROJ_LIB ?= ../../data/for_tests 4D-API-cs2cs-style: 4D-API_cs2cs-style.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< GDA: GDA.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< axisswap: axisswap.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< builtins: builtins.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< deformation: deformation.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< ellipsoid: ellipsoid.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< more_builtins: more_builtins.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< unitconvert: unitconvert.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< DHDN_ETRS89: DHDN_ETRS89.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< geotiff_grids: geotiff_grids.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< check-local: 4D-API-cs2cs-style GDA axisswap builtins deformation ellipsoid more_builtins unitconvert DHDN_ETRS89 geotiff_grids diff --git a/test/gigs/Makefile.am b/test/gigs/Makefile.am index 22ab099bb0..436a6e89eb 100644 --- a/test/gigs/Makefile.am +++ b/test/gigs/Makefile.am @@ -23,54 +23,54 @@ EXTRA_DIST = \ PROJ_LIB ?= ../../data/for_tests 5101.1: 5101.1-jhs.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5101.2: 5101.2-jhs.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5101.3: 5101.3-jhs.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5101.4: 5101.4-jhs-etmerc.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5102.1: 5102.1.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5103.1: 5103.1.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5103.2: 5103.2.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5103.3: 5103.3.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5105.2: 5105.2.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5106: 5106.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5107: 5107.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5109: 5109.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5111.1: 5111.1.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5112: 5112.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5113: 5113.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5201: 5201.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< 5208: 5208.gie - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< check-local: 5101.1 5101.2 5101.3 5101.4 5102.1 5103.1 5103.2 5103.3 5105.2 5106 5107 5109 5111.1 5112 5113 5201 5208 diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index f5890f1a02..845d07e510 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -71,7 +71,7 @@ target_link_libraries(proj_pj_transform_test ${PROJ_LIBRARIES}) add_test(NAME proj_pj_transform_test COMMAND proj_pj_transform_test) set_property(TEST proj_pj_transform_test - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") add_executable(proj_errno_string_test @@ -82,7 +82,7 @@ target_link_libraries(proj_errno_string_test ${PROJ_LIBRARIES}) add_test(NAME proj_errno_string_test COMMAND proj_errno_string_test) set_property(TEST proj_errno_string_test - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") add_executable(proj_angular_io_test main.cpp @@ -92,7 +92,7 @@ target_link_libraries(proj_angular_io_test ${PROJ_LIBRARIES}) add_test(NAME proj_angular_io_test COMMAND proj_angular_io_test) set_property(TEST proj_angular_io_test - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") add_executable(proj_context_test main.cpp @@ -102,7 +102,7 @@ target_link_libraries(proj_context_test ${PROJ_LIBRARIES}) add_test(NAME proj_context_test COMMAND proj_context_test) set_property(TEST proj_context_test - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") if(MSVC AND BUILD_LIBPROJ_SHARED) # ph_phi2_test not compatible of a .dll build @@ -115,7 +115,7 @@ else() ${PROJ_LIBRARIES}) add_test(NAME pj_phi2_test COMMAND pj_phi2_test) set_property(TEST pj_phi2_test - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") endif() add_executable(proj_test_cpp_api @@ -136,7 +136,7 @@ target_link_libraries(proj_test_cpp_api ${SQLITE3_LIBRARY}) add_test(NAME proj_test_cpp_api COMMAND proj_test_cpp_api) set_property(TEST proj_test_cpp_api - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") add_executable(gie_self_tests @@ -147,7 +147,7 @@ target_link_libraries(gie_self_tests ${PROJ_LIBRARIES}) add_test(NAME gie_self_tests COMMAND gie_self_tests) set_property(TEST gie_self_tests - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests") add_executable(test_network @@ -163,4 +163,4 @@ target_link_libraries(test_network ${SQLITE3_LIBRARY}) add_test(NAME test_network COMMAND test_network) set_property(TEST test_network - PROPERTY ENVIRONMENT "PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests;PROJ_SOURCE_DATA=${PROJECT_SOURCE_DIR}/data") + PROPERTY ENVIRONMENT "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES;PROJ_LIB=${PROJECT_BINARY_DIR}/data/for_tests;PROJ_SOURCE_DATA=${PROJECT_SOURCE_DIR}/data") diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index 86ed383a5b..11a6473cf9 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -23,7 +23,7 @@ pj_transform_test_SOURCES = pj_transform_test.cpp main.cpp pj_transform_test_LDADD = ../../src/libproj.la @GTEST_LIBS@ pj_transform_test-check: pj_transform_test - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./pj_transform_test + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./pj_transform_test pj_phi2_test_SOURCES = pj_phi2_test.cpp main.cpp pj_phi2_test_LDADD = ../../src/libproj.la @GTEST_LIBS@ @@ -47,19 +47,19 @@ proj_context_test_SOURCES = proj_context_test.cpp main.cpp proj_context_test_LDADD = ../../src/libproj.la @GTEST_LIBS@ proj_context_test-check: proj_context_test - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES ./proj_context_test + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES ./proj_context_test test_cpp_api_SOURCES = test_util.cpp test_common.cpp test_crs.cpp test_metadata.cpp test_io.cpp test_operation.cpp test_datum.cpp test_factory.cpp test_c_api.cpp test_grids.cpp main.cpp test_cpp_api_LDADD = ../../src/libproj.la @GTEST_LIBS@ @SQLITE3_LIBS@ test_cpp_api-check: test_cpp_api - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./test_cpp_api + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./test_cpp_api gie_self_tests_SOURCES = gie_self_tests.cpp main.cpp gie_self_tests_LDADD = ../../src/libproj.la @GTEST_LIBS@ @SQLITE3_LIBS@ gie_self_tests-check: gie_self_tests - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./gie_self_tests + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) ./gie_self_tests include_proj_h_from_c_SOURCES = include_proj_h_from_c.c @@ -68,6 +68,6 @@ test_network_CXXFLAGS = @CURL_CFLAGS@ @CURL_ENABLED_FLAGS@ test_network_LDADD = ../../src/libproj.la @GTEST_LIBS@ @SQLITE3_LIBS@ @CURL_LIBS@ test_network-check: test_network - PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) PROJ_SOURCE_DATA=$(PROJ_LIB) ./test_network + PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) PROJ_SOURCE_DATA=$(PROJ_LIB) ./test_network check-local: pj_transform_test-check pj_phi2_test-check proj_errno_string_test-check proj_angular_io_test-check proj_context_test-check test_cpp_api-check gie_self_tests-check test_network-check diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index fc0f074846..bcf311399a 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -348,9 +348,9 @@ TEST(gie, info_functions) { /* proj_info() */ /* this one is difficult to test, since the output changes with the setup */ - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=")); info = proj_info(); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES")); if (info.version[0] != '\0') { char tmpstr[64]; diff --git a/test/unit/proj_context_test.cpp b/test/unit/proj_context_test.cpp index ec59590d78..30d6d78194 100644 --- a/test/unit/proj_context_test.cpp +++ b/test/unit/proj_context_test.cpp @@ -159,18 +159,18 @@ TEST(proj_context, read_grid_from_user_writable_directory) { auto filename = path + DIR_CHAR + "temp_proj_dic3"; EXPECT_TRUE(createTmpFile(filename)); { - // Check that with PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES (set by + // Check that with PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES (set by // calling script), we cannot find the file auto P = proj_create(ctx, "+init=temp_proj_dic3:MY_PIPELINE"); EXPECT_EQ(P, nullptr); proj_destroy(P); } { - // Cancel the effect of PROJ_IGNORE_USER_WRITABLE_DIRECTORY - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=")); + // Cancel the effect of PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=")); auto P = proj_create(ctx, "+init=temp_proj_dic3:MY_PIPELINE"); EXPECT_NE(P, nullptr); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES")); proj_destroy(P); } proj_context_destroy(ctx); diff --git a/test/unit/test_network.cpp b/test/unit/test_network.cpp index 688e61e560..241e6bbc57 100644 --- a/test/unit/test_network.cpp +++ b/test/unit/test_network.cpp @@ -1577,7 +1577,7 @@ TEST(networking, download_whole_files) { unlink("proj_test_tmp/dvr90.tif"); rmdir("proj_test_tmp"); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=")); putenv(const_cast("PROJ_USER_WRITABLE_DIRECTORY=./proj_test_tmp")); putenv(const_cast("PROJ_FULL_FILE_CHUNK_SIZE=100000")); auto ctx = proj_context_create(); @@ -1699,7 +1699,7 @@ TEST(networking, download_whole_files) { ASSERT_EQ(vectPct.back().second, 1.0); proj_context_destroy(ctx); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES")); putenv(const_cast("PROJ_USER_WRITABLE_DIRECTORY=")); putenv(const_cast("PROJ_FULL_FILE_CHUNK_SIZE=")); unlink("proj_test_tmp/cache.db"); @@ -1719,7 +1719,7 @@ TEST(networking, file_api) { unlink("proj_test_tmp/dvr90.tif"); rmdir("proj_test_tmp"); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=")); putenv(const_cast("PROJ_USER_WRITABLE_DIRECTORY=./proj_test_tmp")); putenv(const_cast("PROJ_FULL_FILE_CHUNK_SIZE=30000")); auto ctx = proj_context_create(); @@ -1843,7 +1843,7 @@ TEST(networking, file_api) { ASSERT_TRUE(userData.in_seek); proj_context_destroy(ctx); - putenv(const_cast("PROJ_IGNORE_USER_WRITABLE_DIRECTORY=YES")); + putenv(const_cast("PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES")); putenv(const_cast("PROJ_USER_WRITABLE_DIRECTORY=")); putenv(const_cast("PROJ_FULL_FILE_CHUNK_SIZE=")); unlink("proj_test_tmp/cache.db");