Fixed units tests

This commit is contained in:
Matthias Koefferlein 2022-02-12 18:20:38 +01:00
parent 8091464916
commit 72d0f717fe
2 changed files with 7 additions and 3 deletions

View File

@ -219,7 +219,7 @@ struct trans_defs
"\n"
"@return The inverted transformation\n"
) +
method ("ctrans", &C::ctrans, arg ("d"),
method ("ctrans|*", &C::ctrans, arg ("d"),
"@brief Transforms a distance\n"
"\n"
"The \"ctrans\" method transforms the given distance.\n"
@ -229,6 +229,8 @@ struct trans_defs
"\n"
"@param d The distance to transform\n"
"@return The transformed distance\n"
"\n"
"The product '*' has been added as a synonym in version 0.28."
) +
method ("trans|*", (point_type (C::*) (const point_type &) const) &C::trans, arg ("p"),
"@brief Transforms a point\n"
@ -752,6 +754,8 @@ struct cplx_trans_defs
"\n"
"@param d The distance to transform\n"
"@return The transformed distance\n"
"\n"
"The product '*' has been added as a synonym in version 0.28."
) +
method ("trans|*", (target_point_type (C::*) (const point_type &) const) &C::trans, arg ("p"),
"@brief Transforms a point\n"

View File

@ -80,8 +80,8 @@ class DBTrans_TestClass < TestBase
assert_equal( RBA::Trans::new(RBA::Trans::R180, RBA::DVector::new(5,-7)).to_s, "r180 5,-7" )
assert_equal( RBA::Trans::new(RBA::Trans::R180).to_s, "r180 0,0" )
assert_equal( e.ctrans( 2.0 ).to_s, "2" )
assert_equal( (e * 2.0).to_s, "2" )
assert_equal( e.ctrans( 2.0 ), 2.0 )
assert_equal( e * 2.0, 2.0 )
assert_equal( e.trans( RBA::Edge::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )
assert_equal( ( e * RBA::Edge::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )
assert_equal( e.trans( RBA::Box::new(0, 1, 2, 3) ).to_s, "(-3,-2;-1,0)" )