|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <board.h>#include <drc/rule_editor/drc_re_custom_rule_constraint_data.h>#include <drc/rule_editor/drc_re_loaded_rule.h>#include <drc/rule_editor/drc_re_numeric_input_constraint_data.h>#include <drc/rule_editor/drc_re_panel_matcher.h>#include <drc/rule_editor/drc_re_via_style_constraint_data.h>#include <drc/rule_editor/drc_rule_document.h>#include <drc/rule_editor/drc_rule_editor_enums.h>#include <drc/rule_editor/drc_rule_editor_utils.h>#include <dialogs/panel_setup_constraint_rules.h>#include <dialogs/panel_setup_constraints.h>#include <dialogs/panel_setup_mask_and_paste.h>#include <wx/ffile.h>#include <wx/filename.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (UneditedRulesRoundTripVerbatim) | |
| BOOST_AUTO_TEST_CASE (AddingARuleLeavesTheOthersUntouched) | |
| BOOST_AUTO_TEST_CASE (AMergedRuleIsWrittenBackAsOneRule) | |
| BOOST_AUTO_TEST_CASE (MoveSwapsWithTheNeighbourOfTheSameConstraint) | |
| BOOST_AUTO_TEST_CASE (TextOnlyRuleListsUnderEachConstraintItSets) | |
| BOOST_AUTO_TEST_CASE (ImportingFromABoardWithoutARulesFileChangesNothing) | |
| BOOST_AUTO_TEST_CASE (ImportingFromABoardWithRulesReplacesThem) | |
| BOOST_AUTO_TEST_CASE (TypographicQuotesInAFileOnDiskStillParse) | |
| BOOST_AUTO_TEST_CASE (ARangeWithOneEndIsNotGivenAnInventedBound) | |
| BOOST_AUTO_TEST_CASE (ARangeWithBothEndsStillReachesItsPanel) | |
| BOOST_AUTO_TEST_CASE (AnEditedTextRuleKeepsItsIndent) | |
| BOOST_AUTO_TEST_CASE (AWidthOrGapMissingABoundIsKeptAsWritten) | |
| BOOST_AUTO_TEST_CASE (ASplitRuleKeepsThePredicateItsPartsShare) | |
| BOOST_AUTO_TEST_CASE (AConditionThePanelCannotWriteBackIsKeptAsWritten) | |
| BOOST_AUTO_TEST_CASE (AViaTypeChosenForASplitRuleNarrowsOnlyTheViaPart) | |
| BOOST_AUTO_TEST_CASE (RenamingOneConstraintRenamesTheWholeRule) | |
| BOOST_AUTO_TEST_CASE (RulesAddedSeparatelyStayApartWhenTheyShareAName) | |
| BOOST_AUTO_TEST_CASE (TextRuleMovesAmongTheRulesOfThePageItIsShownOn) | |
| BOOST_AUTO_TEST_CASE (ATextRuleIsListedOnceWhenTwoSectionsShareAConstraintCode) | |
| BOOST_AUTO_TEST_CASE (TextThatDoesNotParseIsKeptAsWritten) | |
| BOOST_AUTO_TEST_CASE (ConstraintCodeMustEndAtADelimiter) | |
| BOOST_AUTO_TEST_CASE (DuplicateFollowsItsOriginalAsAnIndependentRule) | |
| BOOST_AUTO_TEST_CASE (DuplicatingACopyCountsOnFromTheOriginalName) | |
| BOOST_AUTO_TEST_CASE (RuleNamesAreUniqueWithinAConstraint) | |
| BOOST_AUTO_TEST_CASE (SplitRuleIsListedOnceOnItsSiblingsPage) | |
| BOOST_AUTO_TEST_CASE (EveryBoardConstraintWithRulesResolvesToAPage) | |
| BOOST_AUTO_TEST_CASE (EveryBoardDefaultIsWrittenByOnePageOnly) | |
| BOOST_AUTO_TEST_CASE (EveryConstraintWithARulePageHasItsDefaultThere) | |
| BOOST_AUTO_TEST_CASE (EachDefaultTravelsWithItsImportGroup) | |
| BOOST_AUTO_TEST_CASE (AConditionedDefaultSitsWithTheConstraintItNarrows) | |
| BOOST_AUTO_TEST_CASE | ( | AConditionedDefaultSitsWithTheConstraintItNarrows | ) |
Definition at line 869 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), and PANEL_SETUP_CONSTRAINT_RULES::PageEditingDefault().
| BOOST_AUTO_TEST_CASE | ( | AConditionThePanelCannotWriteBackIsKeptAsWritten | ) |
Definition at line 447 of file test_drc_rule_document.cpp.
References BOOST_REQUIRE_EQUAL(), DRC_RE_LOADED_PANEL_ENTRY::condition, DRC_RE_LOADED_PANEL_ENTRY::constraintData, DRC_RULE_DOCUMENT::Entries(), DRC_RE_BASE_CONSTRAINT_DATA::GetRuleCondition(), DRC_RULE_DOCUMENT::GetText(), DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | AddingARuleLeavesTheOthersUntouched | ) |
Definition at line 104 of file test_drc_rule_document.cpp.
References DRC_RULE_DOCUMENT::Add(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), DRC_RULE_EDITOR_UTILS::CreateConstraintData(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::IsModified(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::NextId(), RPT_SEVERITY_UNDEFINED, DRC_RULE_DOCUMENT::SetText(), and text.
| BOOST_AUTO_TEST_CASE | ( | AMergedRuleIsWrittenBackAsOneRule | ) |
Definition at line 131 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), DRC_RE_LOADED_PANEL_ENTRY::constraintData, DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), HOLE_SIZE, DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | AnEditedTextRuleKeepsItsIndent | ) |
Definition at line 349 of file test_drc_rule_document.cpp.
References BOOST_REQUIRE_EQUAL(), CUSTOM_RULE, DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), index, DRC_RULE_DOCUMENT::IndicesFor(), DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | ARangeWithBothEndsStillReachesItsPanel | ) |
Definition at line 329 of file test_drc_rule_document.cpp.
References ABSOLUTE_LENGTH, BOOST_CHECK_EQUAL(), CUSTOM_RULE, DRC_RULE_DOCUMENT::IndicesFor(), MATCHED_LENGTH_DIFF_PAIR, ROUTING_DIFF_PAIR, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | ARangeWithOneEndIsNotGivenAnInventedBound | ) |
Definition at line 294 of file test_drc_rule_document.cpp.
References BOOST_REQUIRE_MESSAGE(), DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | ASplitRuleKeepsThePredicateItsPartsShare | ) |
Definition at line 408 of file test_drc_rule_document.cpp.
References DRC_RE_LOADED_PANEL_ENTRY::condition, DRC_RE_LOADED_PANEL_ENTRY::constraintData, DRC_RULE_DOCUMENT::Entries(), DRC_RE_BASE_CONSTRAINT_DATA::GetRuleCondition(), DRC_RULE_DOCUMENT::GetText(), DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | ATextRuleIsListedOnceWhenTwoSectionsShareAConstraintCode | ) |
Definition at line 589 of file test_drc_rule_document.cpp.
References ABSOLUTE_LENGTH, BOOST_REQUIRE_EQUAL(), CUSTOM_RULE, DRC_RULE_DOCUMENT::IndicesFor(), MATCHED_LENGTH_DIFF_PAIR, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | AViaTypeChosenForASplitRuleNarrowsOnlyTheViaPart | ) |
Definition at line 484 of file test_drc_rule_document.cpp.
References BOOST_REQUIRE_EQUAL(), DRC_RE_LOADED_PANEL_ENTRY::condition, DRC_RE_LOADED_PANEL_ENTRY::constraintData, DRC_RULE_DOCUMENT::Entries(), DRC_RE_BASE_CONSTRAINT_DATA::GetRuleCondition(), DRC_RULE_DOCUMENT::GetText(), index, DRC_RULE_DOCUMENT::IndicesFor(), MICRO, DRC_RULE_DOCUMENT::SetText(), text, DRC_RULE_DOCUMENT::UpdateEntry(), and VIA_STYLE.
| BOOST_AUTO_TEST_CASE | ( | AWidthOrGapMissingABoundIsKeptAsWritten | ) |
Definition at line 377 of file test_drc_rule_document.cpp.
References BOOST_REQUIRE_MESSAGE(), DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, and DRC_RULE_DOCUMENT::UpdateEntry().
| BOOST_AUTO_TEST_CASE | ( | ConstraintCodeMustEndAtADelimiter | ) |
Definition at line 631 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), DRC_RULE_DOCUMENT::FindConstraintClause(), and text.
| BOOST_AUTO_TEST_CASE | ( | DuplicateFollowsItsOriginalAsAnIndependentRule | ) |
Definition at line 643 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), copy, DRC_RULE_DOCUMENT::Duplicate(), DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::IsModified(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::SetText(), and text.
| BOOST_AUTO_TEST_CASE | ( | DuplicatingACopyCountsOnFromTheOriginalName | ) |
Definition at line 698 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), DRC_RULE_DOCUMENT::Duplicate(), DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | EachDefaultTravelsWithItsImportGroup | ) |
Definition at line 832 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_REQUIRE_MESSAGE(), PANEL_SETUP_CONSTRAINTS::CopySettings(), PANEL_SETUP_MASK_AND_PASTE::CopySettings(), PANEL_SETUP_CONSTRAINT_RULES::EditedDefaults(), BOARD::GetDesignSettings(), and group.
| BOOST_AUTO_TEST_CASE | ( | EveryBoardConstraintWithRulesResolvesToAPage | ) |
Definition at line 758 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), DRC_PANEL_MATCHER::GetHomePanel(), NULL_CONSTRAINT, PANEL_SETUP_CONSTRAINT_RULES::PageTitleFor(), and PANEL_SETUP_CONSTRAINT_RULES::RulesCanOverride().
| BOOST_AUTO_TEST_CASE | ( | EveryBoardDefaultIsWrittenByOnePageOnly | ) |
Definition at line 787 of file test_drc_rule_document.cpp.
References PANEL_SETUP_CONSTRAINT_RULES::EditedDefaults(), group, and PANEL_SETUP_CONSTRAINT_RULES::PageEditingDefault().
| BOOST_AUTO_TEST_CASE | ( | EveryConstraintWithARulePageHasItsDefaultThere | ) |
Definition at line 814 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), and PANEL_SETUP_CONSTRAINT_RULES::PageEditingDefault().
| BOOST_AUTO_TEST_CASE | ( | ImportingFromABoardWithoutARulesFileChangesNothing | ) |
Definition at line 221 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::LoadFrom(), MINIMUM_CLEARANCE, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | ImportingFromABoardWithRulesReplacesThem | ) |
Definition at line 240 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DRC_RULE_DOCUMENT::GetText(), HOLE_SIZE, DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::IsModified(), DRC_RULE_DOCUMENT::LoadFrom(), MINIMUM_CLEARANCE, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | MoveSwapsWithTheNeighbourOfTheSameConstraint | ) |
Definition at line 165 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::Move(), DRC_RULE_DOCUMENT::SetText(), and text.
| BOOST_AUTO_TEST_CASE | ( | RenamingOneConstraintRenamesTheWholeRule | ) |
Definition at line 515 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), clearance, DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, DRC_RE_LOADED_PANEL_ENTRY::ruleName, DRC_RULE_DOCUMENT::SetText(), text, DRC_RULE_DOCUMENT::UpdateEntry(), and VIA_STYLE.
| BOOST_AUTO_TEST_CASE | ( | RuleNamesAreUniqueWithinAConstraint | ) |
Definition at line 715 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), HOLE_SIZE, DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::IsRuleNameUnique(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::SetText(), and DRC_RULE_DOCUMENT::UniqueRuleName().
| BOOST_AUTO_TEST_CASE | ( | RulesAddedSeparatelyStayApartWhenTheyShareAName | ) |
Definition at line 541 of file test_drc_rule_document.cpp.
References DRC_RULE_DOCUMENT::Add(), DRC_RULE_EDITOR_UTILS::ConstraintToKicadDrc(), DRC_RULE_EDITOR_UTILS::CreateConstraintData(), DRC_RULE_DOCUMENT::GetText(), HOLE_SIZE, MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::NextId(), RPT_SEVERITY_UNDEFINED, and text.
| BOOST_AUTO_TEST_CASE | ( | SplitRuleIsListedOnceOnItsSiblingsPage | ) |
Definition at line 738 of file test_drc_rule_document.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), CUSTOM_RULE, DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | TextOnlyRuleListsUnderEachConstraintItSets | ) |
Definition at line 202 of file test_drc_rule_document.cpp.
References DRC_RULE_DOCUMENT::Add(), BOOST_CHECK_EQUAL(), CUSTOM_RULE, HOLE_SIZE, DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, MINIMUM_VIA_DIAMETER, DRC_RULE_DOCUMENT::NextId(), and RPT_SEVERITY_UNDEFINED.
| BOOST_AUTO_TEST_CASE | ( | TextRuleMovesAmongTheRulesOfThePageItIsShownOn | ) |
Definition at line 563 of file test_drc_rule_document.cpp.
References DRC_RULE_DOCUMENT::Add(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), CUSTOM_RULE, DRC_RULE_DOCUMENT::Entries(), DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::Move(), DRC_RULE_DOCUMENT::NextId(), RPT_SEVERITY_UNDEFINED, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | TextThatDoesNotParseIsKeptAsWritten | ) |
Definition at line 609 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::HasUnparsedText(), DRC_RULE_DOCUMENT::IndicesFor(), DRC_RULE_DOCUMENT::IsModified(), MINIMUM_CLEARANCE, and DRC_RULE_DOCUMENT::SetText().
| BOOST_AUTO_TEST_CASE | ( | TypographicQuotesInAFileOnDiskStillParse | ) |
Definition at line 265 of file test_drc_rule_document.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DRC_RULE_DOCUMENT::GetText(), DRC_RULE_DOCUMENT::HasUnparsedText(), DRC_RULE_DOCUMENT::IndicesFor(), L, DRC_RULE_DOCUMENT::LoadFrom(), and MINIMUM_CLEARANCE.
| BOOST_AUTO_TEST_CASE | ( | UneditedRulesRoundTripVerbatim | ) |
Definition at line 82 of file test_drc_rule_document.cpp.
References DRC_RULE_DOCUMENT::Add(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), DRC_RULE_EDITOR_UTILS::CreateConstraintData(), DRC_RULE_DOCUMENT::GetText(), HOLE_SIZE, DRC_RULE_DOCUMENT::IndicesFor(), MINIMUM_CLEARANCE, DRC_RULE_DOCUMENT::NextId(), DRC_RULE_DOCUMENT::Remove(), RPT_SEVERITY_UNDEFINED, and DRC_RULE_DOCUMENT::SetText().