From 40ab72f2e9d913c7128fde24576183068dcd7ee2 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 28 Sep 2021 14:47:10 +0200 Subject: PROJStringFormatter: add optimizations useful for IAU CRS transformation pipelines --- test/unit/test_io.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 646a990a..4e888f2c 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -7881,6 +7881,26 @@ TEST(io, projstringformatter_axisswap_minus_two_one_followed_two_one) { // --------------------------------------------------------------------------- +TEST(io, projstringformatter_axisswap_two_minus_one_followed_minus_two_one) { + auto fmt = PROJStringFormatter::create(); + fmt->ingestPROJString("+proj=pipeline " + "+step +proj=axisswap +order=2,-1 " + "+step +proj=axisswap +order=-2,1"); + EXPECT_EQ(fmt->toString(), "+proj=noop"); +} + +// --------------------------------------------------------------------------- + +TEST(io, projstringformatter_axisswap_two_minus_one_followed_one_minus_two) { + auto fmt = PROJStringFormatter::create(); + fmt->ingestPROJString("+proj=pipeline " + "+step +proj=axisswap +order=2,-1 " + "+step +proj=axisswap +order=1,-2"); + EXPECT_EQ(fmt->toString(), "+proj=axisswap +order=2,1"); +} + +// --------------------------------------------------------------------------- + TEST(io, projstringformatter_unmodified) { const char *const strs[] = {"+proj=pipeline " "+step +proj=axisswap +order=2,-1 " -- cgit v1.2.3