From ebe38912a6fdeb0cfd367945a0ffadd8bf6075fd Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 27 Oct 2021 23:36:58 +0200 Subject: [PATCH] Tests and documentation for dbTrans#is_complex? --- src/db/db/gsiDeclDbTrans.cc | 7 ++++--- testdata/ruby/dbTransTest.rb | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/db/db/gsiDeclDbTrans.cc b/src/db/db/gsiDeclDbTrans.cc index a14eaa66b..397378c17 100644 --- a/src/db/db/gsiDeclDbTrans.cc +++ b/src/db/db/gsiDeclDbTrans.cc @@ -926,10 +926,11 @@ struct cplx_trans_defs "@param m The new magnification" ) + method ("is_complex?", &C::is_complex, - "@brief Return true if the transformation is a complex one\n" + "@brief Returns true if the transformation is a complex one\n" "\n" - "If this value is false, the transformation can safely be converted to a simple transformation.\n" - "The return value is equivalent to 'is_mag || !is_ortho'.\n" + "If this predicate is false, the transformation can safely be converted to a simple transformation.\n" + "Otherwise, this conversion will be lossy.\n" + "The predicate value is equivalent to 'is_mag || !is_ortho'.\n" "\n" "This method has been introduced in version 0.27.5." ) + diff --git a/testdata/ruby/dbTransTest.rb b/testdata/ruby/dbTransTest.rb index d69244910..e98cc4d87 100644 --- a/testdata/ruby/dbTransTest.rb +++ b/testdata/ruby/dbTransTest.rb @@ -155,6 +155,7 @@ class DBTrans_TestClass < TestBase assert_equal( c.is_unity?, false ) assert_equal( c.is_ortho?, true ) assert_equal( c.is_mag?, false ) + assert_equal( c.is_complex?, false ) assert_equal( c.is_mirror?, true ) assert_equal( c.rot, RBA::DCplxTrans::M135.rot ) assert_equal( c.s_trans.to_s, "m135 0,0" ) @@ -179,6 +180,7 @@ class DBTrans_TestClass < TestBase assert_equal( c.is_unity?, false ) assert_equal( c.is_ortho?, true ) assert_equal( c.is_mag?, true ) + assert_equal( c.is_complex?, true ) assert_equal( c.is_mirror?, false ) assert_equal( c.rot, RBA::DCplxTrans::R0.rot ) assert_equal( c.s_trans.to_s, "r0 0,0" ) @@ -190,6 +192,7 @@ class DBTrans_TestClass < TestBase assert_equal( c.to_s, "m22.5 *0.75 2.5,-12.5" ) assert_equal( c.is_unity?, false ) assert_equal( c.is_ortho?, false ) + assert_equal( c.is_complex?, true ) assert_equal( c.is_mag?, true ) assert_equal( c.rot, RBA::DCplxTrans::M0.rot ) assert_equal( c.s_trans.to_s, "m0 2.5,-12.5" )