From 9095cf6fa351b5e6208cec811b86eb3d958c6f06 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 30 Oct 2019 16:56:41 +0100 Subject: 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. --- test/unit/test_c_api.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/unit/test_c_api.cpp') 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); -- cgit v1.2.3