40 mgr.SetEnvironment( &
board,
nullptr,
nullptr,
nullptr,
nullptr );
53 addCommit.
Push( wxT(
"add constraint" ) );
56 BOOST_CHECK( board.ResolveItem(
id,
true ) == c );
61 removeCommit.
Push( wxT(
"remove constraint" ) );
63 BOOST_CHECK( board.Constraints().empty() );
64 BOOST_CHECK( board.ResolveItem(
id,
true ) ==
nullptr );
78 BOOST_CHECK( board.Constraints().empty() );
89 addCommit.
Push( wxT(
"add" ) );
97 BOOST_CHECK_CLOSE( *c->
GetValue(), 1.0, 1e-9 );
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
virtual void Revert() override
Revert the commit by restoring the modified items state.
Information pertinent to a Pcbnew printed circuit board.
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
A geometric constraint between board items (issue #2329).
std::optional< double > GetValue() const
void SetValue(std::optional< double > aValue)
@ HORIZONTAL
A segment (or two points) is horizontal.
@ FIXED_LENGTH
A segment has a driving length value.
@ PARALLEL
Two segments are parallel.
KI_TEST::DUMMY_TOOL * tool
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_FIXTURE_TEST_CASE(AddPushThenRemovePush, COMMIT_FIXTURE)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")