aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-10-30 16:56:41 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-10-30 17:49:39 +0100
commit9095cf6fa351b5e6208cec811b86eb3d958c6f06 (patch)
tree771aed528565271f68509090396e6ed4555802dc /test/unit/test_c_api.cpp
parentfc769bbd9a4fb61e96e500788d24d1d12019a4d0 (diff)
downloadPROJ-9095cf6fa351b5e6208cec811b86eb3d958c6f06.tar.gz
PROJ-9095cf6fa351b5e6208cec811b86eb3d958c6f06.zip
createFromWkt(): be tolerant to missing scale_factor parameter (fixes #1700)
This is invalid WKT, but GDAL 2.4 used to accept it and make a reasonable use of it... Currently we default it to 0 which is non sensical. Better use 1 as GDAL 2.4 did, and emit a warning. Other fix: proj_create_from_wkt() was documented to operate by default in non-strict validation mode, but it was actually in strict mode. So do as documented.
Diffstat (limited to 'test/unit/test_c_api.cpp')
-rw-r--r--test/unit/test_c_api.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 8ac5a511..b8310ce5 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -231,7 +231,8 @@ TEST_F(CApi, proj_create_from_wkt) {
" PRIMEM[\"Greenwich\",0],\n"
" UNIT[\"degree\",0.0174532925199433]]",
nullptr, nullptr, nullptr);
- EXPECT_EQ(obj, nullptr);
+ ObjectKeeper keeper(obj);
+ EXPECT_NE(obj, nullptr);
}
{
PROJ_STRING_LIST warningList = nullptr;
@@ -244,7 +245,8 @@ TEST_F(CApi, proj_create_from_wkt) {
" PRIMEM[\"Greenwich\",0],\n"
" UNIT[\"degree\",0.0174532925199433]]",
nullptr, &warningList, &errorList);
- EXPECT_EQ(obj, nullptr);
+ ObjectKeeper keeper(obj);
+ EXPECT_NE(obj, nullptr);
EXPECT_EQ(warningList, nullptr);
proj_string_list_destroy(warningList);
EXPECT_NE(errorList, nullptr);