diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-10-30 15:56:41 +0000 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-10-30 16:49:39 +0000 |
| commit | 970946b5668b31c1f2498db4b1dbc83871d52a91 (patch) | |
| tree | 620f96fc1516f05ca7f0f3980d64f3195d803795 /test/unit/test_c_api.cpp | |
| parent | 45b2d5ff3b085ce8c67c34dc27c7fdcb012b0cc3 (diff) | |
| download | PROJ-970946b5668b31c1f2498db4b1dbc83871d52a91.tar.gz PROJ-970946b5668b31c1f2498db4b1dbc83871d52a91.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.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 7fd0e742..0a860d1f 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); |
