20#include <boost/test/tools/old/interface.hpp>
39 return aStream <<
"<no groups>";
42 std::vector<JUMPER_GROUP> groups = aGroups.
GetAll();
44 aStream << groups.size() <<
" group(s): ";
45 for(
size_t ii = 0; ii < groups.size(); ++ii )
52 for(
const wxString&
name : groups[ii].GetNames() )
53 aStream <<
"\"" <<
name <<
"\" ";
74 const std::vector<PARSED_JUMPER_TEST_CASE> valid_jumper_groups = {
98 "(\"1\" \"2\" \"3\")",
99 { {
"1",
"2",
"3" } },
103 "(\"1\") (\"2\") (\"3\")",
104 { {
"1" }, {
"2" }, {
"3" } },
108 "(\"1\" \"2\") (\"3\" \"4\") (\"5\" \"6\")",
109 { {
"1",
"2" }, {
"3",
"4" }, {
"5",
"6" } },
117 std::string good =
"(symbol \"Good\" (jumper_pin_groups " + test_case.input +
"))";
121 BOOST_REQUIRE_EQUAL( loaded.size(), 1u );
127 for(
const std::set<wxString>& groupNames : test_case.expected_groups )
128 expected_groups.
Add( std::move( groupNames ) );
139 const std::vector<std::string> throwing_jumper_groups = {
154 for(
const std::string& bad_jumper_group : throwing_jumper_groups )
158 std::string bad =
"(symbol \"Bad\" (jumper_pin_groups " + bad_jumper_group +
"))";
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Represents an (ordered) list of JUMPER_GROUP objects.
void Add(JUMPER_GROUP aGroup)
Add a JUMPER_GROUP to the set.
const std::vector< JUMPER_GROUP > & GetAll() const
Define a library symbol object.
JUMPER_GROUP_SET & JumperPinGroups()
Each jumper pin group is a set of pin numbers that should be treated as internally connected.
static std::vector< LIB_SYMBOL * > ParseLibSymbols(std::string &aSymbolText, std::string aSource, int aFileVersion=SEXPR_SCHEMATIC_FILE_VERSION)
std::vector< std::set< wxString > > expected_groups
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
std::ostream & boost_test_print_type(std::ostream &aStream, const JUMPER_GROUP_SET &aGroups)
Boost.Test print helper for jumper group collections.
BOOST_AUTO_TEST_CASE(WellFormedJumperPinGroupsAreParsed)
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")