aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-18 18:42:31 +0200
committerGitHub <noreply@github.com>2020-10-18 18:42:31 +0200
commit2357d264d477c5eee363514fb094772980509726 (patch)
treec4bdcbe7d36d961a9a55241844fe1977d3434aad /test/unit/test_c_api.cpp
parent3a2df3462c851b7dc823b1cd84fc8a61dc9c2d08 (diff)
parentffe1922d54d4ce379c96f5472dba2e76223348f1 (diff)
downloadPROJ-2357d264d477c5eee363514fb094772980509726.tar.gz
PROJ-2357d264d477c5eee363514fb094772980509726.zip
Merge pull request #2381 from rouault/fix_1453
Add multi-line PROJ string export capability, and use it by default in projinfo (unless --single-line is specified) (fixes #1543)
Diffstat (limited to 'test/unit/test_c_api.cpp')
-rw-r--r--test/unit/test_c_api.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index c0db3880..f6371cc3 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -3764,16 +3764,26 @@ TEST_F(CApi, proj_coordoperation_create_inverse) {
ObjectKeeper keeper_Pinversed(Pinversed);
ASSERT_NE(Pinversed, nullptr);
- auto projstr = proj_as_proj_string(m_ctxt, Pinversed, PJ_PROJ_5, nullptr);
+ const char *options[] = {"MULTILINE=YES", "INDENTATION_WIDTH=4",
+ "MAX_LINE_LENGTH=40", nullptr};
+ auto projstr = proj_as_proj_string(m_ctxt, Pinversed, PJ_PROJ_5, options);
ASSERT_NE(projstr, nullptr);
- EXPECT_EQ(std::string(projstr),
- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
- "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 "
- "+step +proj=cart +ellps=WGS84 +step +inv +proj=helmert +x=293 "
- "+y=836 +z=318 +rx=0.5 +ry=1.6 +rz=-2.8 +s=2.1 "
- "+convention=position_vector +step +inv +proj=cart "
- "+ellps=evrst30 +step +proj=pop +v_3 +step +proj=unitconvert "
- "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
+ const char *expected_projstr = "+proj=pipeline\n"
+ " +step +proj=axisswap +order=2,1\n"
+ " +step +proj=unitconvert +xy_in=deg\n"
+ " +xy_out=rad\n"
+ " +step +proj=push +v_3\n"
+ " +step +proj=cart +ellps=WGS84\n"
+ " +step +inv +proj=helmert +x=293\n"
+ " +y=836 +z=318 +rx=0.5 +ry=1.6\n"
+ " +rz=-2.8 +s=2.1\n"
+ " +convention=position_vector\n"
+ " +step +inv +proj=cart +ellps=evrst30\n"
+ " +step +proj=pop +v_3\n"
+ " +step +proj=unitconvert +xy_in=rad\n"
+ " +xy_out=deg\n"
+ " +step +proj=axisswap +order=2,1";
+ EXPECT_EQ(std::string(projstr), expected_projstr);
}
// ---------------------------------------------------------------------------