20#include <boost/test/unit_test.hpp>
23#include <api/common/types/base_types.pb.h>
41 const VECTOR2I nativeSchIu( 50000, 75000 );
43 kiapi::common::types::Vector2 wire;
57 const VECTOR2I nativeSchIu( 50000, 75000 );
59 kiapi::common::types::Vector2 wire;
66 BOOST_CHECK_NE( asPcb.
x, nativeSchIu.
x );
78 kiapi::common::types::Vector2 wire;
99 const int toleranceNm = 10 * 100;
100 const int toleranceSchIu =
schIUScale.NmToIU( toleranceNm );
constexpr EDA_IU_SCALE schIUScale
constexpr EDA_IU_SCALE pcbIUScale
Segment description base class to describe items which have 2 end points (track, wire,...
int GetPenWidth() const override
void SetStartPoint(const VECTOR2I &aPosition)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetEndPoint(const VECTOR2I &aPosition)
KICOMMON_API VECTOR2I UnpackVector2(const types::Vector2 &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackVector2(types::Vector2 &aOutput, const VECTOR2I &aInput, const EDA_IU_SCALE &aScale)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
static void roundTrip(const DIFF_VALUE &aValue)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(UnpackVector2RoundTripsThroughSchIuScale)
Regression tests for the IU-scale handling in API_HANDLER_EDITOR::handleHitTest.
VECTOR2< int32_t > VECTOR2I